fabricatio_comfyui.actions

Actions for ComfyUI image generation workflow.

Classes

ComfyuiGenerateImage

Queue a ComfyUI workflow and wait for the generated images.

ComfyuiUploadImage

Upload an image to the ComfyUI server (e.g. for img2img workflows).

Package Contents

class fabricatio_comfyui.actions.ComfyuiGenerateImage(/, **data: Any)

Bases: fabricatio_core.models.action.Action, fabricatio_comfyui.capabilities.comfyui.Comfyui

Queue a ComfyUI workflow and wait for the generated images.

The workflow field should contain a full ComfyUI workflow graph (exported via “Save (API Format)” from the ComfyUI interface). Use download_dir to save images locally.

output_key: str = 'comfyui_result'

The key used to store this action’s output in the context dictionary.

workflow: dict[str, Any] = None

The ComfyUI workflow graph to execute.

download_dir: str | pathlib.Path | None = None

If set, download output images to this directory.

poll_interval: float = 1.0

Seconds between progress polling requests.

timeout: float | None = None

Maximum seconds to wait for completion.

class fabricatio_comfyui.actions.ComfyuiUploadImage(/, **data: Any)

Bases: fabricatio_core.models.action.Action, fabricatio_comfyui.capabilities.comfyui.Comfyui

Upload an image to the ComfyUI server (e.g. for img2img workflows).

output_key: str = 'comfyui_upload_result'

The key used to store this action’s output in the context dictionary.

image_path: str | pathlib.Path = None

Path to the image file to upload.

image_type: str = 'input'

input or temp.

Type:

Target directory