Extensions/DiffSynth-ComfyUI
ComfyUI Extension

DiffSynth-ComfyUI

A ComfyUI custom node plugin for DiffSynth-Studio, enabling low-VRAM inference through configurable VRAM management, NF4 quantization, and model offloading. Supports image, video, and audio generation and editing across 20+ diffusion models.

By modelscope·Created 2 months ago·Updated a day ago· 11
modelscope/DiffSynth-ComfyUI
Nodes56
On cloudLocal install
CategoryDiffSynth/inference, DiffSynth/loader
Stars11
Updateda day ago

Nodes (56)

DiffSynth: ACE-Step Inference

ACE-Step Inference — a song in eight steps, lyrics included

DiffSynth/inference
DiffSynth: ACE-Step Loader

ACE-Step Loader — three weight files, one tokenizer directory, one music pipe

DiffSynth/loader
DiffSynth: Anima Inference

Anima Inference — tags, prose, and both at once

DiffSynth/inference
DiffSynth: Anima Loader

Anima Loader — the 2B anime model, loaded properly

DiffSynth/loader
DiffSynth: Boogu Image Inference

Boogu Image Inference — four steps, storyboards, and text that survives

DiffSynth/inference
DiffSynth: Boogu Image Loader

Boogu Image Loader — Base, Turbo or Edit, declared file by file

DiffSynth/loader
DiffSynth: ERNIE Image Inference

ERNIE Image Inference — layout and text, if you can live with the grid

DiffSynth/inference
DiffSynth: ERNIE Image Loader

ERNIE Image Loader — a Turbo transformer that borrows everything else

DiffSynth/loader
DiffSynth: FLUX.2 Inference

FLUX.2 Inference — Klein in four steps, and a mask socket for inpainting

DiffSynth/inference
DiffSynth: FLUX.2 Loader

FLUX.2 Loader — 56B of dev, or Klein if you'd like it to fit

DiffSynth/loader
DiffSynth: FLUX Inference

FLUX Inference — the node with thirty-odd sockets, explained

DiffSynth/inference
DiffSynth: FLUX Loader

FLUX Loader — one node for a dozen FLUX.1-era checkpoints

DiffSynth/loader
DiffSynth: HiDream O1 Inference

HiDream O1 Inference — 2048px, pixel-space, and an edit socket

DiffSynth/inference
DiffSynth: HiDream O1 Loader

HiDream O1 Loader — two ModelConfigs, because there's no VAE to load

DiffSynth/loader
DiffSynth: Ideogram 4 Inference

Ideogram 4 Inference — write the prompt as JSON, not prose

DiffSynth/inference
DiffSynth: Ideogram 4 Loader

Ideogram 4 Loader — four model files, one of them the unconditional branch

DiffSynth/loader
DiffSynth: JoyAI Image Inference

JoyAI Image Inference — an edit node you prompt, not a text-to-image sampler

DiffSynth/inference
DiffSynth: JoyAI Image Loader

JoyAI Image Loader — the quiet one, and how to wire it

DiffSynth/loader
DiffSynth: Krea 2 Inference

Krea 2 Inference — 8 steps turbo or 52 steps raw, pick your CFG

DiffSynth/inference
DiffSynth: Krea 2 Loader

Krea 2 Loader — Raw, Turbo, and a Qwen3-VL text encoder

DiffSynth/loader
DiffSynth: LingBot Video Inference

LingBot Video Inference — physics first, and it shows in the settings

DiffSynth/inference
DiffSynth: LingBot Video Loader

LingBot Video Loader — it wants a prompt rewriter, and the pack knows it

DiffSynth/loader
DiffSynth: LoRA Clear

LoRA Clear — the one-input node that saves you a reload

DiffSynth/LoRA
DiffSynth: LoRA Load

LoRA Load — with alpha instead of strength, and no ComfyUI lora folder

DiffSynth/LoRA
DiffSynth: LTX-2 Audio Video Inference

LTX-2 Audio Video Inference — the whole node, including retake

DiffSynth/inference
DiffSynth: LTX-2 Audio Video Loader

LTX-2 Audio Video Loader — the two-stage knob lives here

DiffSynth/loader
DiffSynth: Merge ModelConfigs

The boring node every DiffSynth graph runs through

DiffSynth/config
DiffSynth: MiniMax H3 Inference

MiniMax H3 Inference — keyframes, references, retake and the flow-shift dials

DiffSynth/inference
DiffSynth: MiniMax H3 Loader

MiniMax H3 Loader — 42.5GB of weights, and one flag that stops you downloading them twice

DiffSynth/loader
DiffSynth: MiniMax Music 3 Inference

MiniMax Music 3 Inference — prompt the arrangement, tag the lyrics

DiffSynth/inference
DiffSynth: MiniMax Music 3 Loader

MiniMax Music 3 Loader — six files between you and a song

DiffSynth/loader
DiffSynth: Mixed Quantize Config

Mixed Quantize Config — different bit-widths for different layers

DiffSynth/config
DiffSynth: ModelConfig

ModelConfig — the node that decides what actually gets downloaded

DiffSynth/config
DiffSynth: MOVA Audio Video Inference

MOVA Audio Video Inference — first frame in, picture and sound out

DiffSynth/inference
DiffSynth: MOVA Audio Video Loader

MOVA Audio Video Loader — the open AV model that had no ComfyUI path

DiffSynth/loader
DiffSynth: Quantization Config

Quantization Config — what it takes to fit a 20B at home

DiffSynth/config
DiffSynth: Qwen Image 2.1 Inference

Qwen Image 2.1 Inference — generation and editing from the same node

DiffSynth/inference
DiffSynth: Qwen Image 2.1 Loader

Qwen Image 2.1 Loader — the unified generation-and-editing Qwen, with weights

DiffSynth/loader
DiffSynth: Qwen Image Inference

Qwen Image Inference — one node that does T2I, editing, inpainting and layer decomposition

DiffSynth/inference
DiffSynth: Qwen Image Loader

Qwen Image Loader — three files, two configs, one pipe

DiffSynth/loader
DiffSynth: Qwen Video Edit Inference

Repaint a whole clip with one sentence per chunk

DiffSynth/inference
DiffSynth: Qwen Video Edit Loader

The five ModelConfig files this thing really needs

DiffSynth/loader
DiffSynth: SenseNova U1 Image Inference

4K generation and editing on an 8B model that thinks first

DiffSynth/inference
DiffSynth: SenseNova U1 Image Loader

Two ModelConfigs, one of them sneaky

DiffSynth/loader
DiffSynth: Stable Diffusion Inference

Yes, it still works, and here's why you'd bother

DiffSynth/inference
DiffSynth: Stable Diffusion Loader

Four files, one pipe, no surprises

DiffSynth/loader
DiffSynth: Stable Diffusion XL Inference

1024 native, dual CLIP, and one widget that mostly does nothing

DiffSynth/inference
DiffSynth: Stable Diffusion XL Loader

Five ModelConfigs and two tokenizers before you see a picture

DiffSynth/loader
DiffSynth: VRAM Config

The four-stage dial that decides whether anything fits

DiffSynth/config
DiffSynth: VRAM Limit

How much of your card the pipeline is allowed to eat

DiffSynth/config
DiffSynth: Wan Video Inference

One node, every Wan variant, and about forty sockets you can ignore

DiffSynth/inference
DiffSynth: Wan Video Loader

One loader, every Wan task, and a redirect you should leave alone

DiffSynth/loader
DiffSynth: YuE2 Inference

Lyrics in, a whole song out, and a score you can actually edit

DiffSynth/inference
DiffSynth: YuE2 Loader

Two model files plus two text-side files that are easy to forget

DiffSynth/loader
DiffSynth: Z-Image Inference

8 steps, CFG 1, and a negative prompt that does nothing

DiffSynth/inference
DiffSynth: Z-Image Loader

Turbo or Base, one ModelConfig list away

DiffSynth/loader
Readme

DiffSynth-ComfyUI

A ComfyUI custom node plugin for the open-source framework DiffSynth-Studio. It integrates DiffSynth-Studio's model configuration, quantization, LoRA, and inference pipeline capabilities into ComfyUI, enabling node-based image, video, and audio generation and editing.

<p align="center"> <img src="https://github.com/user-attachments/assets/be990357-5b44-4f3b-b646-a80f2f7567d5" alt="DiffSynth-ComfyUI" width="100%"> </p>

Installation

Option 1: ComfyUI Registry

ComfyUI Desktop / ComfyUI-Manager:

  • Open the sidebar Manage Extensions or Manager
  • Search for DiffSynth-ComfyUI
  • Click Install, then restart ComfyUI

Option 2: Manual git clone

  1. Install ComfyUI
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI
pip install -r requirements.txt
  1. Install DiffSynth-Studio
pip install git+https://github.com/modelscope/DiffSynth-Studio.git
  1. Install this plugin
cd ComfyUI/custom_nodes
git clone https://github.com/modelscope/DiffSynth-ComfyUI.git
cd ..
python main.py

If you need quantization features, install the quantization extras:

pip install "diffsynth[quant] @ git+https://github.com/modelscope/DiffSynth-Studio.git"

Once started, open the ComfyUI address shown in the terminal (typically http://127.0.0.1:8188) in your browser.

Quick Start

Using Preset Workflows

  1. Open the ComfyUI interface
  2. Click the Template tab in the left sidebar and select any DiffSynth template
  3. Modify parameters such as prompt and seed in the Inference node
  4. Click Run

Building a Workflow from Scratch

Right-click on a blank canvas to add nodes, then connect them in the following order:

VRAMConfig → ModelConfig → MergeModelConfigs ───┐
                                                ├──→ Loader → Inference → SaveImage
                              VRAMLimit ────────┘

Example: Qwen-Image Text-to-Image

  1. Add a VRAM Config node to configure VRAM strategy for each stage (optional)
  2. Add 3 ModelConfig nodes with the following settings:
    • model_id: Qwen/Qwen-Image, origin_file_pattern: transformer/diffusion_pytorch_model*.safetensors
    • model_id: Qwen/Qwen-Image, origin_file_pattern: text_encoder/model*.safetensors
    • model_id: Qwen/Qwen-Image, origin_file_pattern: vae/diffusion_pytorch_model.safetensors
  3. Connect the VRAM Config output to the vram_config input of all 3 ModelConfig nodes
  4. Add a Merge ModelConfigs node and connect the outputs of the 3 ModelConfig nodes
  5. Add a VRAM Limit node (optional)
  6. Add a Qwen Image Loader node and connect model_configs and vram_limit
  7. Add a Qwen Image Inference node and connect the pipe output from the Loader
  8. Add a built-in SaveImage node and connect the image output from the Inference node
  9. Fill in the prompt in the Inference node and click Run

Node Reference

All nodes are located under the DiffSynth category in the ComfyUI node menu, organized into 4 subcategories:

DiffSynth/config — Model & VRAM Configuration

| Node | Function | |------|----------| | VRAM Config | Configures DiffSynth-Studio's four-level VRAM management strategy (offload / onload / preparing / computation), specifying device and data dtype for each stage. Connect the output to the vram_config input of ModelConfig nodes. | | VRAM Limit | Limits the available VRAM during inference, reserving buffer_size GB for the system. Connect the output to the vram_limit input of the Loader. | | ModelConfig | Declares a model file's download source (model_id) and file path (origin_file_pattern). | | Merge ModelConfigs | Merges multiple ModelConfig nodes into a single list for the Loader's model_configs input. | | Quantization Config | Configures the model quantization scheme. method selects the quantization method (supports bitsandbytes NF4/FP4, etc.), mode selects the quantization mode. Optionally use target_modules and exclude_modules to control the quantization scope. Connect the output to the quant_config input of ModelConfig. | | Mixed Quantize Config | Combines multiple Quantization Configs to apply different quantization strategies to different modules. Outputs a merged quant_config after connecting multiple Quantization Config inputs. |

DiffSynth/loader — Pipeline Loaders

Each pipeline has a corresponding Loader node that loads model weights, applies VRAM management strategy, and returns a pipe object.

Inputs:

  • model_configs (required): Merged configuration from Merge ModelConfigs
  • torch_dtype: Model precision
  • device: Inference device
  • vram_limit (optional): From a VRAM Limit node
  • Other optional parameters: Vary by pipeline

DiffSynth/inference — Pipeline Inference

Each pipeline has a corresponding Inference node that receives a pipe object and performs inference.

Parameters fall into two categories:

  • Widgets: Parameters such as prompt, seed, num_inference_steps, height, and width that can be edited directly on the node
  • Connection inputs: Parameters such as input_image and edit_image that are passed in via connections

DiffSynth/LoRA — LoRA Management

| Node | Function | |------|----------| | LoRA Clear | Clears all loaded LoRA weights on the pipeline. Usage: connect the pipe output from the Loader, then chain to LoRA Load after clearing old weights | | LoRA Load | Loads a LoRA weight to a specified module. lora_config connects to a ModelConfig (declaring the LoRA file source), module specifies the target module, and alpha controls the strength. Multiple LoRA Load nodes can be chained to stack multiple LoRAs: Loader → LoRA Clear → LoRA Load → LoRA Load → Inference |