Skip to content

IC-LoRA support for Z-Image Turbo#2798

Merged
bghira merged 3 commits into
mainfrom
feature/more-ic-lora-support
Jun 25, 2026
Merged

IC-LoRA support for Z-Image Turbo#2798
bghira merged 3 commits into
mainfrom
feature/more-ic-lora-support

Conversation

@bghira

@bghira bghira commented Jun 24, 2026

Copy link
Copy Markdown
Owner

This pull request adds support for IC-LoRA (Intrinsic Conditioning LoRA) reference-based conditioning to the Z-Image model and pipeline, including Canny edge conditioning. It introduces new configuration and data backend examples for Canny conditioning, updates the Z-Image model to handle reference conditioning latents, and extends the pipeline to process and combine reference images and latents for training and inference. Several validation and normalization steps are added to ensure correct handling of conditioning data.

Z-Image IC-LoRA reference conditioning support:

  • Added methods to the ZImageModel class to support, validate, and normalize IC-LoRA conditioning latents, including new logic for combining reference and target latents and handling batch dimension alignment. [1] [2] [3]
  • Updated the model_predict method to process IC-LoRA conditioning latents, combine them with target latents, and ensure output cropping matches the target width. [1] [2]

Pipeline and inference enhancements:

  • Extended the Z-Image pipeline with methods to encode and normalize reference images into latents, combine them with target latents, and crop outputs as needed. The pipeline __call__ method now accepts a reference_image argument. [1] [2]

Example and configuration additions:

  • Added new example config files for Z-Image Canny conditioning (z-image-turbo.peft-lora+canny-conditioning/config.json and DDP8 variant), and a data backend config for Canny edge conditioning using the Domokun dataset. [1] [2] [3]
  • Updated README.md to document the new Z-Image Canny conditioning examples.

Training and data handling improvements:

  • Improved training sample path logic to better handle cases where instance data directories are not set, ensuring correct path resolution for conditioning data.

These changes collectively enable reference-based conditioning for Z-Image LoRA training and inference, with robust validation and new example configurations to demonstrate usage.

@bghira bghira merged commit 0fdefb7 into main Jun 25, 2026
2 checks passed
@bghira bghira deleted the feature/more-ic-lora-support branch June 25, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant