Flux FP8 Dual CFG Workflow

Details

Download Files

Model description

This ComfyUI workflow implements the inference methodology developed by AmericanPresidentJimmyCarter for optimized LoRA-augmented image generation using the FLUX.1 dev model. It uses two KSamplers to split the inference process, applying different CFG scales at distinct timesteps.

This is currently the best way to use AndroFlux.

Use the all-in-one Flux checkpoint in this workflow, or just copy and paste the two KSamplers into your own workflow.

Key Methodology:

  • Dual KSampler Configuration:

    1. Initial KSampler (Timesteps 0-2):

      • CFG: 1.0 (disabled)

      • Steps: 3

      • Denoise: 1.00

      • VAE Decode: False

    2. Refinement KSampler (Timesteps 3-30):

      • CFG: 3.0

      • Steps: 27

      • Denoise: 0.93 (adjust based on total steps)

      • VAE Decode: True

Insights:

  • Inference Optimization: This setup mimics the CFG adjustment strategy in Jimmy's flux_lora_cfg.py. It starts with a neutral CFG to establish the image foundation, then applies stronger guidance to refine details and enhance prompt adherence.

  • FP8 Quantized Checkpoint: The workflow uses the FP8 quantized version of FLUX.1 [dev], which integrates the VAE and text encoders into a single file. This all-in-one model (flux1-dev-fp8.safetensors) is more convenient but comes with a quality trade-off due to quantization.

Differences from Previous Workflows:

  • Unified Checkpoint: Unlike my previous workflows that used separate files for model components, this version employs a single, integrated checkpoint. While more convenient, it's important to note that this FP8 version may have slightly lower quality compared to the original non-quantized files.

  • Dynamic CFG Strategy: The dual KSampler approach allows for more nuanced control over the generation process, directly implementing Jimmy's findings on optimal CFG timing for Flux LoRAs.

For more information on Flux workflows in ComfyUI, refer to the official ComfyUI Flux documentation.

Images made by this model

No Images Found.