wenjian bc58887756 docs: add example workflow
- Add workflows/zimage_i2l_example_api.json as API workflow example
- Update README with example workflow section
2026-01-29 00:33:51 +08:00
2026-01-29 00:33:51 +08:00
v1
2026-01-28 07:11:03 +00:00
2026-01-29 00:22:30 +08:00
2026-01-29 00:33:51 +08:00

ComfyUI Z-Image I2L (Image to LoRA)

License

ComfyUI custom nodes for Z-Image Image-to-LoRA generation. Generate personalized LoRA weights from reference images using DiffSynth-Studio's Z-Image pipeline.

✨ Features

  • Image to LoRA: Generate LoRA weights directly from reference images
  • No Training Required: Instant LoRA generation without traditional fine-tuning
  • ComfyUI Integration: Seamless workflow integration with standard LoRA nodes

🛠️ Installation

  1. Clone this repository into your ComfyUI custom nodes folder:
cd ComfyUI/custom_nodes
git clone https://github.com/HM-RunningHub/ComfyUI_RH_ZImageI2L.git
  1. Install dependencies:
pip install -r requirements.txt

📦 Model Downloads

Models will be automatically downloaded from ModelScope on first run and cached locally.

Required Models

Model Description Files
Tongyi-MAI/Z-Image Base transformer transformer/*.safetensors
Tongyi-MAI/Z-Image-Turbo Text encoder, VAE & Tokenizer text_encoder/*.safetensors, vae/, tokenizer/
DiffSynth-Studio/General-Image-Encoders Image encoders SigLIP2-G384/, DINOv3-7B/
DiffSynth-Studio/Z-Image-i2L Image to LoRA model model.safetensors

Model Cache Path

Models are automatically downloaded and cached in the ModelScope cache directory:

OS Default Cache Path
Linux ~/.cache/modelscope/hub/
Windows C:\Users\<username>\.cache\modelscope\hub\
macOS ~/.cache/modelscope/hub/

The directory structure after download:

~/.cache/modelscope/hub/
├── Tongyi-MAI/
│   ├── Z-Image/
│   │   └── transformer/*.safetensors
│   └── Z-Image-Turbo/
│       ├── text_encoder/*.safetensors
│       ├── vae/diffusion_pytorch_model.safetensors
│       └── tokenizer/
└── DiffSynth-Studio/
    ├── General-Image-Encoders/
    │   ├── SigLIP2-G384/model.safetensors
    │   └── DINOv3-7B/model.safetensors
    └── Z-Image-i2L/
        └── model.safetensors

Custom Cache Directory

You can customize the cache directory by setting the MODELSCOPE_CACHE environment variable:

# Linux/macOS
export MODELSCOPE_CACHE=/path/to/your/cache

# Windows (PowerShell)
$env:MODELSCOPE_CACHE = "D:\models\modelscope"

# Windows (CMD)
set MODELSCOPE_CACHE=D:\models\modelscope

🚀 Usage

Nodes

Node Description
ZImageI2L Loader Load the Z-Image I2L pipeline
ZImageI2L LoRA Generator Generate LoRA from input images
ZImageI2L Saver Save generated LoRA to output folder

Basic Workflow

  1. Add ZImageI2L Loader to load the pipeline
  2. Connect your reference images to ZImageI2L LoRA Generator
  3. Use ZImageI2L Saver to save the generated LoRA
  4. Use the generated LoRA with any standard LoRA loader node

Example Workflow

An example API workflow is provided in the workflows folder:

This workflow includes:

  • Loading reference images (4 images)
  • Generating LoRA with ZImageI2L nodes
  • Applying the generated LoRA to Z-Image model
  • Generating images with the personalized LoRA

📝 Parameters

ZImageI2L LoRA Generator

Parameter Type Description
pipeline RH_ZImageI2LPipeline Pipeline from Loader node
training_images IMAGE Reference images for LoRA generation
seed INT Random seed for reproducibility

⚠️ Requirements

  • VRAM: 24GB+ recommended (tested on RTX 4090)
  • Python: 3.10+
  • ComfyUI: Latest version

🙏 Acknowledgments

📄 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

S
Description
No description provided
Readme
50 KiB
Languages
Python 100%