Neural network for Stable Diffusion latent space interoperability
Top 90.6% on sourcepulse
This project provides a neural network-based ComfyUI custom node that enables direct interoperability between latent spaces of different Stable Diffusion models, bypassing the need for VAE re-encoding. It targets users of Stable Diffusion who want to leverage latents from newer models (like SDXL, SD3, Flux.1, Stable Cascade) with older architectures (SDv1.x) or vice-versa, offering a more streamlined workflow and potentially preserving finer details.
How It Works
The interposer utilizes a small neural network, trained to map latents from one Stable Diffusion model's latent space to another. This approach avoids the lossy VAE decode/encode cycle, aiming to preserve image fidelity and composition. The training process involves minimizing multiple loss functions, including direct latent reconstruction (p_loss
, b_loss
) and round-trip consistency (r_loss
, h_loss
), to ensure accurate transformations between different latent representations.
Quick Start & Requirements
custom_nodes/SD-Latent-Interposer
or placing comfy_latent_interposer.py
in ComfyUI/custom_nodes/
.huggingface-hub
(pip install huggingface-hub
).custom_nodes/SD-Latent-Interposer/models
.Highlighted Details
Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
1 year ago
1 day