IC-LoRA support for Z-Image Turbo#2798
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
ZImageModelclass 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]model_predictmethod 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:
__call__method now accepts areference_imageargument. [1] [2]Example and configuration additions:
z-image-turbo.peft-lora+canny-conditioning/config.jsonand DDP8 variant), and a data backend config for Canny edge conditioning using the Domokun dataset. [1] [2] [3]README.mdto document the new Z-Image Canny conditioning examples.Training and data handling improvements:
These changes collectively enable reference-based conditioning for Z-Image LoRA training and inference, with robust validation and new example configurations to demonstrate usage.