Skip to content

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

Choose a tag to compare

@Chaoses-Ib Chaoses-Ib released this 06 Sep 22:23
· 66 commits to main since this release

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)