Successfully implemented full compatibility between PuLID (Pure and Lightning ID) face identity preservation and Chroma models (fine-tuned FLUX derivatives) in ComfyUI. This is believed to be the first working implementation of PuLID with Chroma guidance for ComfyUI.
- Split the original
forward_origmethod into two model-specific implementations:forward_orig_flux- For standard FLUX modelsforward_orig_chroma- For Chroma models
- Implemented automatic model detection based on
distilled_guidance_layerattribute - Maintained full backward compatibility with standard FLUX models
- Resolved missing
time_inattribute in Chroma models - Implemented Chroma's custom modulation system:
- Creates 344 modulation vectors using
distilled_guidance_layer - Properly handles timestep and guidance embeddings
- Respects Chroma's block skipping attributes (
skip_mmdit,skip_dit)
- Creates 344 modulation vectors using
- Fixed persistent BFloat16/Half precision mismatches
- Implemented dtype conversion at all critical points:
- Double block PuLID attention
- Single block PuLID attention
- Embedding and image tensor processing
- Ensures compatibility across different precision formats (bfloat16, float16, float8)
- Optimized for AMD RX 6900 XT (16GB VRAM)
- Enables face-consistent generation at 768x768 resolution
- Maintains Chroma's optimal 26-step generation process
- Chroma Model: chroma-unlocked-v35-detail-calibrated_float8_e4m3fn_scaled_stochastic.safetensors
- PuLID Model: pulid_flux_v0.9.1.safetensors (1.06GB)
- Reference: Confirmed working with standard FLUX dev models
- Preserves all original PuLID functionality while adapting to Chroma's architecture
- Handles Chroma's unique modulation-based approach vs FLUX's vector-based system
- Maintains face identity preservation quality across both architectures
- Zero loss in generation quality or face consistency
This implementation enables Chroma users to leverage PuLID's powerful face identity preservation capabilities for the first time in ComfyUI, opening new possibilities for consistent character generation with Chroma's enhanced detail and artistic capabilities.