Z-Image Turbo LoRA Loader:
The ZImageTurboLoraLoader is a specialized node designed to facilitate the loading of LoRA (Low-Rank Adaptation) models specifically for the Z-Image Turbo architecture, also known as Lumina2. This node addresses the common issue of key mismatches that occur when using ComfyUI's generic LoRA loader, which can lead to the silent dropping of attention weights in Z-Image Turbo models. By fusing separate to_q, to_k, and to_v LoRA weights into Z-Image's fused QKV format and remapping keys such as to_out.0 to attention.out, this loader ensures that the architecture-specific requirements of Z-Image Turbo are met. Additionally, it provides per-layer strength control through a JS graph widget, allowing for fine-tuning of the model's performance. This node is essential for users who want to leverage the full potential of Z-Image Turbo models by ensuring that all necessary weights are correctly loaded and applied.
Z-Image Turbo LoRA Loader Input Parameters:
model
The model parameter represents the base model to which the LoRA weights will be applied. It is crucial that this model is compatible with the Lumina2 architecture, as the loader is specifically designed for this type. If the model is not of the Lumina2 type, a warning will be issued. This parameter does not have a default value and must be provided by the user.
lora_<i>
The lora_parameters (where`` ranges from 1 to _MAX_SLOTS) specify the names of the LoRA models to be loaded into each slot. These parameters allow you to load multiple LoRA models simultaneously, with each slot corresponding to a different model. The default value for each slot is "None", indicating that no model is loaded unless specified.
strength_<i>
The strength_`` parameters control the strength of the LoRA model applied in each slot. These parameters allow you to adjust the influence of each LoRA model on the base model, with a default value of 1.0. The strength can be adjusted to fine-tune the model's output according to your needs.
enabled_<i>
The enabled_`` parameters determine whether the LoRA model in each slot is active. By default, these parameters are set to True, meaning that the LoRA models are enabled unless explicitly disabled by setting the parameter to False.
fuse_qkv_<i>
The fuse_qkv_`` parameters indicate whether the separate Q, K, and V weights should be fused into a single QKV format for each LoRA model. This is particularly important for maintaining compatibility with the Z-Image Turbo architecture. The default value is True, enabling the fusion process unless specified otherwise.
Z-Image Turbo LoRA Loader Output Parameters:
current
The current parameter is the output model that has been modified with the applied LoRA weights. This model reflects the cumulative changes made by all enabled and configured LoRA models, providing a final version that incorporates the desired adaptations. The output is crucial for further processing or inference tasks, as it represents the enhanced model ready for use.
Z-Image Turbo LoRA Loader Usage Tips:
- Ensure that the base model is compatible with the Lumina2 architecture to avoid compatibility issues and warnings.
- Use the
strength_`` parameters to fine-tune the influence of each LoRA model, allowing for precise control over the model's behavior. - Enable or disable specific LoRA models using the
enabled_`` parameters to experiment with different combinations and effects.
Z-Image Turbo LoRA Loader Common Errors and Solutions:
Model is <model_type>, not Lumina2.
- Explanation: This warning occurs when the base model provided is not of the Lumina2 type, which is required for compatibility with the ZImageTurboLoraLoader.
- Solution: Ensure that the base model is a Lumina2 model before attempting to load LoRA weights. If necessary, convert or select a compatible model.
Slot <i>: <name> (0 keys)
- Explanation: This message indicates that the specified LoRA model could not be loaded because it contains no keys, possibly due to an incorrect file path or a corrupted file.
- Solution: Verify the file path and integrity of the LoRA model file. Ensure that the file is correctly placed in the designated directory and is not corrupted.
