ComfyScript/docs/Images/README.md at main · jags111/ComfyScript · GitHub
Skip to content

Latest commit

 

History

History
162 lines (140 loc) · 3.49 KB

README.md

File metadata and controls

162 lines (140 loc) · 3.49 KB

Images

Loading

def LoadImageFromPath(
    image: str = r'ComfyUI_00001_-assets\ComfyUI_00001_.png [output]'
) -> tuple[Image, Mask]

One use of this node is to work with Photoshop's Quick Export to quickly perform img2img/inpaint on the edited image. Update: For working with Photoshop, comfyui-photoshop is more convenient and supports waiting for changes. See tutorial at r/comfyui.

def ETNLoadImageBase64(
    image: str
) -> tuple[Image, Mask]

def ETNLoadMaskBase64(
    mask: str
) -> Mask

From empty

def EmptyImage(
    width: int = 512,
    height: int = 512,
    batch_size: int = 1,
    color: int = 0
) -> Image

From Photoshop (not built-in)

def PhotoshopToComfyUI(
    password: str = '12341234',
    wait_for_photoshop_changes: bool = False
) -> tuple[Image, Int, Int]

See tutorial at r/comfyui.

def PILToImage(
    images: PilImage
) -> Image

def PILToMask(
    images: PilImage
) -> Image

From input directory

def LoadImage(
    image: LoadImage.image = 'ComfyUI_00001_.png'
) -> tuple[Image, Mask]

def LoadImageMask(
    image: LoadImageMask.image = 'ComfyUI_00001_.png',
    channel: LoadImageMask.channel = 'alpha'
) -> Mask

Saving

To output directory

def SaveImage(
    images: Image,
    filename_prefix: str = 'ComfyUI'
)

To temp directory

def PreviewImage(
    images: Image
)
def ETNSendImageWebSocket(
    images: Image
)

Sends an output image over the client WebSocket connection as PNG binary data.

To PIL.Image.Image (real mode)

def ImageToPIL(
    images: Image
) -> PilImage

To animation

def SaveAnimatedWEBP(
    images: Image,
    filename_prefix: str = 'ComfyUI',
    fps: float = 6.0,
    lossless: bool = True,
    quality: int = 80,
    method: SaveAnimatedWEBP.method = 'default'
)

def SaveAnimatedPNG(
    images: Image,
    filename_prefix: str = 'ComfyUI',
    fps: float = 6.0,
    compress_level: int = 4
)

Masking

Creating:

def SolidMask(
    value: float = 1.0,
    width: int = 512,
    height: int = 512
) -> Mask

def ImageToMask(
    image: Image,
    channel: ImageToMask.channel = 'red'
) -> Mask

def ImageColorToMask(
    image: Image,
    color: int = 0
) -> Mask

def MaskToImage(
    mask: Mask
) -> Image

Applying:

def ETNApplyMaskToImage(
    image: Image,
    mask: Mask
) -> Image

Batching

def ImageBatch(
    image1: Image,
    image2: Image
) -> Image

def RebatchImages(
    images: Image,
    batch_size: int = 1
) -> Image

def RepeatImageBatch(
    image: Image,
    amount: int = 1
) -> Image