Skip to content

Conversation

@devgdovg
Copy link
Contributor

@devgdovg devgdovg commented Jan 1, 2026

Motivation

  • Make Nunchaku Z-Image model loaded by NunchakuZImageDiTLoader be able to run with LoRAs
  • Make LoRA loading/unloading process for Nunchaku Z-Image model be aligned with general LoRA Loader provided by ComfyUI, instead of implementing a customized LoRA loader for Nunchaku Z-Image only. See the screen shot below.
image

Modifications

  • Create a new class ZImageModelPatcher that inherits comfy.model_patcher.ModelPatcher. The ZImageModelPatcher overrides a bunch of methods of its parent in order to inject LoRA loading/unloading for quantized SVDQ linear modules.
  • Add a test case featured two cascaded native ComfyUI LoRA loaders.

Checklist

  • Code is formatted using Pre-Commit hooks (run pre-commit run --all-files).
  • Relevant unit tests are added in the tests/workflows directory following the guidance in the Contribution Guide.
  • Reference images are uploaded to PR comments and URLs are added to test_cases.json.
  • Additional test data (if needed) is registered in test_data/inputs.yaml.
  • Additional models (if needed) are registered in scripts/download_models.py and test_data/models.yaml.
  • Additional custom nodes (if needed) are added to .github/workflows/pr-test.yaml.
  • For reviewers: If you're only helping merge the main branch and haven't contributed code to this PR, please remove yourself as a co-author when merging.
  • Please feel free to join our Discord or WeChat to discuss your PR.

@@ -0,0 +1,23 @@
[
{
"ref_image_url": "https://huggingface.co/datasets/nunchaku-tech/test-data/resolve/main/ComfyUI-nunchaku/ref_images/nunchaku-z-image-turbo-lora.png",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref image is uploaded to huggingface in this session:
https://huggingface.co/datasets/nunchaku-tech/test-data/discussions/4

@devgdovg devgdovg marked this pull request as ready for review January 1, 2026 16:49
@devgdovg devgdovg changed the title feat: LoRA support for Z Image feat: Nunchaku Z-Image model to be able to load and run LoRAs with native LoRALoader provided by ComfyUI Jan 1, 2026
@devgdovg devgdovg changed the title feat: Nunchaku Z-Image model to be able to load and run LoRAs with native LoRALoader provided by ComfyUI feat: Nunchaku Z-Image model to load and run LoRAs with native LoRALoader node provided by ComfyUI Jan 1, 2026
@devgdovg devgdovg force-pushed the feat/z-image-turbo-lora branch from cc0786b to 4419014 Compare January 1, 2026 18:54
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