ComfyUI Latent VAE tweaker (for SD1.5, SDXL)
Details
Download Files
Model description
This is a tool for manipulating Latent data passed to VAE with ComfyUI and adjusting colors etc. It is also possible to adjust the RGB data output from VAE. This is compatible with 4ch latent, and is essentially for SD1.5 and SDXL (probably SD2.1 as well).
ver.1.1
Some HSV functions did not work properly depending on the connection order. This is because HSV is not enabled unless it is the final stage. In the current version, SV shift is exclusive to other HSV functions. Therefore, I created ver.1.1, which consolidates HSV-related information in one place.
●Image HSV Ajudst
This is a node that summarizes HSV-related operations. Since the input is only Image, normal VAE output
Only this node is located under Image > Color.
You can also select the order in which scale, shift, and gamma processing is performed.If you want to make the color richer, this node alone is sufficient. This node only requires image input, so it can also be used with other 16-component models such as Flux.1 and Qwen-image.
For connections, you can freely place Latent nodes as you like, including using multiple nodes. It can be used alone. Connect the HSV type node to the final stage using Image, and connect it to preview, etc. It is also possible to use HSV alone.
ver1.0
Place latent_interactive_viewer.py in \ComfyUI\custom_nodes and restart ComfyUI.
Three custom nodes are added under Add Node -> latent -> viewer.
The 3 nodes can be used individually, but they can also be connected.
The content of each channel of latent is different between SD1.5 and SDXL, but I think that once you get used to it, you will be able to use it in roughly the same way. The meaning is complicated, but the general meaning is as follows (according to ChatGPT research).
●SD1.5
Ch0 Basics of shape
Ch1 Texture and details
Ch2 Brightness/Shadow etc.
CH3 Color (Hue/Sat)
●SDXL
Ch0 Contour etc.
Ch1 Shape and internal details
Ch2 Hue
CH3 Saturation/lightness
However, since it is a neural network configuration, the distribution of features is ambiguous. Since it works as a whole, it's normal to mess up details when you think you're just playing around with the colors.
Gamma is the gamma curve itself, and the S-shape is like a sigmoid function adjusted so that it becomes a straight line when the number is 1. I recommend using it sparingly with Latent.
The shift value is simply added to the value.
These can be used simply, or by combining nodes, you can do very complex things. When a shift value and an S-shape are combined, the shift in the center of the S-shape will be smaller than that specified by the shift value. If you combine them in multiple stages, you can create a complicated curved graph, but be careful about the parts that are clipped. Well, I think it's practically meaningless.
If you set the output destination to the Save Image node, a save image will be created every time you make adjustments, so if you don't have a lot of storage space, I think it's a good idea to connect it to Preview Image and only connect the things you want to save to Save Image. In the sample workflow, it is muted (toggle with Ctrl-M).
Note: The right side of the sample image is the normal VAE output
