Skip to content

Releases: Chaoses-Ib/ComfyScript

ComfyScript v0.7.0a1

24 Dec 04:29
96e8f47

Choose a tag to compare

ComfyScript v0.7.0a1 Pre-release
Pre-release

Note

To install this pre-release from PyPI (instead of a local git repository), --pre option is needed: pip install -U --pre comfy-script[default]

  • Transpiler: Support formatting node inputs as keyword arguments (#119, @longredzhong)

    The default behavior is changed to format as keyword arguments if there are more than 2 inputs, for example:

    model, clip, vae = CheckpointLoaderSimple('v1-5-pruned-emaonly.ckpt')
    conditioning = CLIPTextEncode('beautiful scenery nature glass bottle landscape, , purple galaxy bottle,', clip)
    conditioning2 = CLIPTextEncode('text, watermark', clip)
    latent = EmptyLatentImage(width=512, height=512, batch_size=1)
    latent = KSampler(model=model, seed=156680208700286, steps=20, cfg=8, sampler_name='euler', scheduler='normal', positive=conditioning, negative=conditioning2, latent_image=latent, denoise=1)
    image = VAEDecode(latent, vae)
    SaveImage(image, 'ComfyUI')

    CLI usage:

      --args [pos|pos2orkwd|kwd]  Format node inputs as positional or keyword
                                  arguments.  [default: Pos2OrKwd]

    e.g. python -m comfy_script.transpile --args kwd workflow.json

  • Runtime: util: Add concat_latents, load_latent_from_path, save_latent_and_get_path (#118,#29)

    For example:

    # For print
    queue.watch_display(False)
    
    with Workflow():
        latent = EmptyLatentImage(batch_size=4)
        latent_path = util.save_latent_and_get_path(latent)
    print(latent_path)
    
    with Workflow():
        latent = util.load_latent_from_path(latent_path)
        # Do something with the latent, for example:
        SaveLatent(latent, 'latents/loaded')

ComfyScript v0.6.1

20 Nov 14:39

Choose a tag to compare

  • fix(runtime,client): event loop closed on Python 3.12+ (#117)

ComfyScript v0.6.0: Simpler to use

19 Nov 22:36

Choose a tag to compare

Note

ComfyScript is a Python frontend and library for ComfyUI. See README for details and examples.

New features

  • Python 3.14 support

    (Solara UI doesn't support Python 3.14 yet: widgetti/solara#1108)

  • Runtime

    • ComfyUI v3 schema support (#113,#85)

    • Add util module with some utlity functions (#29,#47,#76)

      • get_int, get_float, get_str and get_images
      • concat_images
      • save_image and save_image_cwd
      • save_image_and_get_paths and load_image_from_paths

      For example:

      latent = KSampler(...)
      image = VAEDecode(latent, vae)
      images = util.get_images(image)
      # `images` is of type `list[PIL.Image.Image]`
    • Add node module with nodes and get properties (#17, #30, #59)

      See util module for examples.

    • Virtual mode

      • Workflow only queues unqueued outputs (#29)
      • Support progress callbacks (#36,#102)
      • Wake result() when set new output (#108)
    • Change StrEnum stub type to StrEnum | str (#71, @dwgrth)

    • Using loaded comfyui if inside comfyui (#104)

    • Share comfyui package context vars by default

Docs

Changes

  • cli extra (optional dependencies) is now enabled by default

    click is ~100KB. You can still disable this if you like.

Fixes

  • Runtime
    • main.server is no longer the server instance (#86)
    • ComfyUI LogInterceptor breaks Jupyter Notebook
    • redirect __main__.__file__ to ComfyUI/main.py (#89)
    • Node/output type namespace confusion (#22)
    • Virtual mode
      • Node output may be None
      • Extra bool inputs (#22, #80)
      • Output types may be lists (#9,#106)
    • Real mode
      • Unpack result for non-output nodes (#85)
      • Support kwds only valid for prompt (#85)
      • replace invalid chars in type stubs with (#87)
      • Bool enum conversions (#91)
      • new node with original class (#112)
    • comfyui package breaks cli_args
    • comfyui package LogInterceptor breaks Jupyter Notebook too
    • comfyui package receive_all_progress_notifications is readonly now (#65)
  • Transpiler
    • Avoid move same input multiple times (#55)
    • Prompt ignore hidden inputs (#85)
  • Nodes
    • Update ComfyUI_Ib_CustomNodes to fix PILToImage and PILToMask (#83)

v0.5.1

07 Sep 20:45

Choose a tag to compare

Docs

Fixes

  • Runtime: comfyui package not load comfyui-legacy nodes (all additional nodes) (#68)

v0.5.0: Previews, CivitAI nodes, ImageViewer and MetadataViewer

06 Sep 22:23

Choose a tag to compare

Note

ComfyScript is a Python frontend and library for ComfyUI. See README for details and examples.

New features

  • Runtime

  • Transpiler

    • Support converting workflow JSON to runnable scripts via CLI (#43)

      Usage:

      python -m comfy_script.transpile "tests\transpile\default.json" --runtime > script.py
    • Add settings for hook (#27, #38, #42)

      settings.toml:

      [transpile.hook]
      # When ComfyScript is installed as custom nodes, `SaveImage` and similar nodes will be hooked to automatically save the script as the image's metadata. The script will also be printed to the terminal.
      # To disable a feature, change its value to `false`.
      save_script = true
      print_script = true
      
      # Use workflows in API format instead of web UI format when possible.
      # Web UI format contains more information, but may also contain some UI-only virtual nodes (e.g. custom Reroute, PrimitiveNode, Note nodes) that cannot be properly transpiled. API format has better compatibility at the cost of less readable output.
      prefer_api_format = false

      These settings can also be overriden by environment variables and Python code, see settings.example.toml for details.

  • Nodes: Add civitai_comfy_nodes to load checkpoints/loras from CivitAI

    Examples:

    model, clip, vae = CivitAICheckpointLoader('101055@128078')
    model, clip, vae = CivitAICheckpointLoader('https://civitai.com/models/101055?modelVersionId=128078')
    model, clip, vae = CivitAICheckpointLoader('https://civitai.com/models/101055/sd-xl?modelVersionId=128078')
    
    model, clip = CivitAILoraLoader(model, clip, '350450@391994', strength_clip=1, strength_model=1)
    model, clip = CivitAILoraLoader(model, clip, 'https://civitai.com/models/350450?modelVersionId=391994', strength_clip=1, strength_model=1)
    model, clip = CivitAILoraLoader(model, clip, 'https://civitai.com/models/350450/sdxl-lightning-lora-2step?modelVersionId=391994', strength_clip=1, strength_model=1)
  • UI

    • ipywidgets: Add ImageViewer (#51)

      A simple image viewer that can display multiple images with optional titles.

      image

    • Solara: Add MetadataViewer (#49)

      A widget for viewing the metadata of an image generated by ComfyScript / ComfyUI / Stable Diffusion web UI. Workflow JSON files are supported too, including both the web UI format and the API format.

      image

  • Docs

Changes

  • Runtime: Virtual mode: Arguments of queue.watch_display() are changed (#36, #52)

    Before:

    def watch_display(self, display_node: bool = True, display_task: bool = True): ...
    queue.watch_display(False, False)

    Now:

    def watch_display(self, all: bool | None = None, *, preview: bool | None = None, output: bool | None = None, task: bool | None = None): ...
    queue.watch_display(False)
    # or:
    queue.watch_display(preview=False, output=False, task=False)

Fixes

  • Runtime
    • Imported classes may be overridden by custom nodes (#57)
    • Optional inputs should not be set if not provided (#59)
    • Virtual mode
      • Enable connection to https comfyui server (#37, @lucak5s)
      • Not queue the workflow if an exception is raised (#48)
    • Real mode: Fix support for the latest version of comfyui package (#65)
  • Transpiler
    • Fallback to API format if web UI format breaks the transpiler (#42)
    • Read workflow file in UTF-8 encoding (#42)
    • Pos dict and unknown end node in workflow (#42)
    • UI-only node Reroute (rgthree) (#42)

v0.5.0a5

15 May 15:22

Choose a tag to compare

v0.5.0a5 Pre-release
Pre-release
  • feat(runtime/real): add node cache (#34)

v0.5.0a4

09 May 11:10

Choose a tag to compare

v0.5.0a4 Pre-release
Pre-release

New features

  • Runtime: Show progress bar by tqdm instead of custom print()

  • Nodes: Add civitai_comfy_nodes to load checkpoints/loras from CivitAI

    Examples:

    model, clip, vae = CivitAICheckpointLoader('101055@128078')
    model, clip, vae = CivitAICheckpointLoader('https://civitai.com/models/101055?modelVersionId=128078')
    model, clip, vae = CivitAICheckpointLoader('https://civitai.com/models/101055/sd-xl?modelVersionId=128078')
    
    model, clip = CivitAILoraLoader(model, clip, '350450@391994', strength_clip=1, strength_model=1)
    model, clip = CivitAILoraLoader(model, clip, 'https://civitai.com/models/350450?modelVersionId=391994', strength_clip=1, strength_model=1)
    model, clip = CivitAILoraLoader(model, clip, 'https://civitai.com/models/350450/sdxl-lightning-lora-2step?modelVersionId=391994', strength_clip=1, strength_model=1)

v0.5.0a3

03 May 14:15

Choose a tag to compare

v0.5.0a3 Pre-release
Pre-release
  • feat(transpile): add settings for hook (#27, #38)

v0.5.0a2

29 Apr 21:21

Choose a tag to compare

v0.5.0a2 Pre-release
Pre-release
  • fix(client): enable connection to https comfyui server (#37, @lucak5s)

v0.5.0a1

21 Apr 21:42

Choose a tag to compare

v0.5.0a1 Pre-release
Pre-release
  • feat(runtime): add node preview display and callbacks (#36)

Note: To install a pre-release version from PyPI instead of a local git repository, --pre option is needed: pip install -U --pre comfy-script[default]