Nodes/ComfyUI_FluxLayerDiffuse/Flux Transparent Model Loader
ComfyUI Node

Flux Transparent Model Loader

The Flux layer loader that hands you real alpha — and often crashes doing it

By leeguandong·Created about a year ago·Updated about a year ago· 18
Flux Transparent Model Loader
    • model
    modelblack-forest-labs/FLUX.1-dev
    load_t2itrue
    load_i2ifalse
    load_local_modelfalse
    local_flux_pathblack-forest-labs/FLUX.1-dev
    local_vae_path./models/TransparentVAE.pth
    local_lora_path./models/layerlora.safetensors

    Here's the thing nobody tells you about Flux and transparency: the tools that made it easy on SD 1.5 and SDXL mostly stopped there. LayerDiffusion, lllyasviel's trick for baking a real alpha channel into generation instead of cutting it out afterwards, never got an official Flux port - its Forge extension went quiet in 2024. This pack is one of the few things that tries anyway: it wraps RedAIGC's Flux-version-LayerDiffuse diffusers implementation into ComfyUI nodes, and every workflow starts at this loader.

    The catch: as shipped, the loader crashes. Every time, on every machine, before it generates a single pixel. More on that below, because it's fixable in a way that's still annoying.

    What it does

    FluxTransparentModelLoader is a different kind of model loader. It doesn't hand you a ComfyUI-native MODEL that plugs into a KSampler. It builds a dict of things - a full FLUX.1-dev diffusers pipeline, a LayerLoRA applied on top, and a TransparentVAE that converts the model's latents into an RGBA image - and only the two generation nodes in this same pack know how to read it. Don't try to wire its model output into a standard sampler workflow; it will silently do nothing useful.

    Its inputs, in order of how often you'll touch them:

    • model - the base model. Default is black-forest-labs/FLUX.1-dev, which is a gated repo on HuggingFace: you have to accept the license and log in (huggingface-cli login) or the download fails.
    • load_t2i / load_i2i - toggles for which pipelines to build. Text-to-image on by default, image-to-image off. If you plan to use FluxTransparentI2I, flip load_i2i on - and yes, building both means loading FLUX twice.
    • load_local_model - off by default, which means the TransparentVAE and LayerLoRA weights stream down from RedAIGC/Flux-version-LayerDiffuse on HuggingFace automatically. Flip it on to point at local copies via the three optional path fields instead, which is a good idea if you're offline or rerunning a lot.

    Output is one model tensor - the aforementioned bag of pipelines.

    Installing it (the real way)

    The README says ComfyUI Manager support is "on the way", which in 2026 means: it isn't there. Do the manual clone:

    cd ComfyUI/custom_nodes
    git clone https://github.com/leeguandong/ComfyUI_FluxLayerDiffuse.git
    # restart ComfyUI
    

    Here's the gotcha the README leaves out: there's no requirements.txt. Manager installs dependencies from that file; without one, nothing is auto-installed. This pack needs diffusers, transformers, accelerate, safetensors, huggingface_hub, torchvision and opencv, and its import line fails the moment diffusers is missing:

    pip install diffusers transformers accelerate safetensors opencv-python-headless huggingface_hub
    

    Then budget for the actual load: full FLUX.1-dev in bf16 plus the T5 encoder is a big, gated download and a ~24GB+ VRAM footprint. This is not a lightweight cutout tool.

    The crash, and your options

    The loader calls TransparentVAE(None, ...), and the VAE constructor immediately calls None.to(...). Result: AttributeError: 'NoneType' object has no attribute 'to', which is exactly what an r/comfyui user hit on both desktop and portable installs back in April 2025. The repo has one open issue and hasn't been touched since March 2025, so don't hold your breath for a fix.

    Your realistic options: wait for a maintained fork, or work around it - the code is short enough that patching nodes.py to construct the TransparentVAE with a real VAE is a small project, and the layerdiffuse idea itself is sound. Given the pack's state, treat this one as a proof-of-concept you tinker with, not a production dependency.

    Categoryflux_transparent

    Inputs (7)

    NameTypeDefaultDescription
    modelSTRINGblack-forest-labs/FLUX.1-dev
    load_t2iBOOLEANtrue
    load_i2iBOOLEANfalse
    load_local_modelBOOLEANfalse
    local_flux_pathoptSTRINGblack-forest-labs/FLUX.1-dev
    local_vae_pathoptSTRING./models/TransparentVAE.pth
    local_lora_pathoptSTRING./models/layerlora.safetensors

    Outputs (1)

    NameTypeDescription
    modelMODEL