Z-Image Gradient Merger

Details

Model description

I have already created several merge nodes for Z-Image, but this one is likely the easiest to use. You specify and connect Model A and Model B, and the node switches between the DiT sections of the models for the first and second halves of the process. While my previous nodes could achieve the same (or even more complex) results, I have simplified the functionality here. You specify the center point and the transition width. By default, it transitions from Model A to Model B, but this direction can be reversed. The refiner from Model A is used by default, though you can also specify a blending ratio.

center_layer=30, transition_width=0, refiner_ratio=0 → Model A itself
center_layer=0 , transition_width=0, refiner_ratio=1 → Model B itself

To enable this usage, the layer range is set to 0–30 (a range of 0–29 would make it impossible to produce Model A exactly).

Extract the archive, place it in the custom_nodes folder within ComfyUI, and restart ComfyUI. You can find the node under Model Utils/Z-Image.

Simple Usage 1

Simply connect two models and adjust the result by tweaking only the center_layer.

Simple Usage 2

Connect two models and change only the refiner ratio. It is a good idea to try settings like 100% Model A.

Please note that I do not generally recommend blending the refiner sections; it is a very delicate process. However, observing the effects can be a valuable learning experience.

Some models undergo extensive training on the refiner, meaning their scale may differ from standard models. Consequently, simply specifying values ​​via the slider might not yield the expected results. I have not included normalization processing here, as it significantly degrades accuracy.

In this context, "model" refers to the model connection line in ComfyUI, so it is fine to have elements like LoRAs inserted along the path. For instance, if you connect the output of a standard model to Model A and a model with a LoRA applied to Model B, the LoRA processing will be incorporated into the final result. I thought another tool I created would be better suited for that purpose... but when I went to look for it, I couldn't find it. Did I perhaps never release it publicly? Well, it doesn't matter, since I can achieve the same result using the two nodes here.

Images made by this model