Skip to content

v0.4.0: Standalone virtual mode, global enums, node docstrings, and real mode workflow tracking

Choose a tag to compare

@Chaoses-Ib Chaoses-Ib released this 11 Feb 12:54
· 139 commits to main since this release

New features

  • Runtime

    • Standalone virtual mode

      Virtual mode can now start a ComfyUI server by itself. By default, if the server is not available at http://127.0.0.1:8188/, virtual mode will try to start a new ComfyUI server. See load() for details.

    • Global enums

      Some enums are now also available in a shorter form, for example:

      # Before
      CheckpointLoaderSimple.ckpt_name.v1_5_pruned_emaonly
      # After
      Checkpoints.v1_5_pruned_emaonly

      Currently, these global enums include Checkpoints, CLIPs, CLIPVisions, ControlNets, Diffusers, Embeddings, GLIGENs, Hypernetworks, Loras, PhotoMakers, StyleModels, UNETs, UpscaleModels, VAEs and Samplers, Schedulers. See global enums for details.

    • Node docstrings

      Information about the nodes are now added to type stubs, including the display name, description, category, input range and round and output node. For example:

      In standalone virtual mode and real mode, each node's module name will also be added to their docstrings. This can be used to figure out where a node came from.

    • Real mode

      • Workflow tracking (#21)

        Now workflows will be automatically tracked and saved to images in real mode. But note that changes to inputs made by user code instead of nodes will not be tracked. This means the saved workflows are not guaranteed to be able to reproduce the same results. If user code changes have to be made, one can add some custom metadata to keep the results reproducible. See real mode for an example.

      • The hidden inputs of nodes are now shown in type stubs (#21)

        e.g. extra_pnginfo, prompt and unique_id.

      • Improved compatibility with custom nodes by trying to simulate the real ComfyUI environment as far as possible

    • Enums are now of StrEnum and FloatEnum types if applicable. Now their values can be used interchangeably with str and float.

      For example, they can now be used as real mode node arguments.

  • Nodes: New nodes for converting images between Image and PIL.Image.Image, mainly for use in real mode.

    def ImageToPIL(
        images: Image
    ) -> PilImage
    
    def PILToImage(
        images: PilImage
    ) -> Image
    
    def PILToMask(
        images: PilImage
    ) -> Image

    See images for all nodes about loading/saving images.

Changes

  • All dependencies are optional now

    Now ComfyScript should be installed with [default], for example:

    python -m pip install -e ".[default]"

    [default] is necessary to install common dependencies. See pyproject.toml for other options. If no option is specified, comfy-script will be installed without any dependencies.

  • Runtime

    • VAEs enum member names are changed

      For example, foo.vae.pt and foo.vae.safetensors's name will now be foo instead of foo_vae.

    • Real mode: Nodes are now wrapped instead of being directly modified (#20)

Fixes

  • Runtime
    • Ignore invalid str enum values (#22)

      This is mainly for mitigating hacks made by ComfyUI-VideoHelperSuite. See #22 for details.

    • Node output name to id conversion