Nodes/ComfyUI_FluxLayerDiffuse/Flux Transparent T2I
ComfyUI Node

Flux Transparent T2I

Want a glass bottle with a real alpha channel? This is Flux's stab at it

By leeguandong·Created about a year ago·Updated about a year ago· 18
Flux Transparent T2I
  • model
  • image
promptglass bottle, high quality
guidance_scale3.5
num_inference_steps50
width1024
height1024
seed11111

Text-to-image that outputs an actual transparent PNG, straight out of the sampler, no background removal afterwards. That's the promise, and it's the Flux version of a trick that made people go wild on SDXL back in 2024 - LayerDiffusion, lllyasviel's latent-transparency approach. Where post-generation cutout tools (BiRefNet, rembg, the whole crew) have to guess where transparency belongs, this generates the alpha at the same time as the pixels. Hair, smoke, and glass get real partial transparency instead of a matte that falls apart on a coloured background.

That's the good news. The bad news is the scaffolding around this node.

How it works

FluxTransparentT2I doesn't sample the way a normal ComfyUI node does. It runs the prompt through a diffusers FluxPipeline (the full FLUX.1-dev stack, bf16), but asks for latents instead of a decoded image. Then a special TransparentVAE - a small UNet trained to predict a fourth alpha channel from the standard VAE decode plus the latent - produces an RGBA image. The layerlora.safetensors that the loader applied is what steers FLUX to draw things as layers with clean alpha in the first place.

The inputs you actually set:

  • prompt - plain text, default glass bottle, high quality. Natural language works; this is Flux.
  • guidance_scale - default 3.5. Flux likes low guidance; start there before cranking it.
  • num_inference_steps - default 50, range up to 100. Good default.
  • width / height - default 1024 each, multiples of 8 up to 2048.
  • seed - default 11111, for reproducible runs.

Output is a single image - a 4-channel RGBA tensor. Wire it to a save node; if you want to actually see the alpha, view it in an editor that shows a checkerboard, because plenty of preview tools flatten to RGB and you'll think nothing happened.

Using it

This node is downstream of FluxTransparentModelLoader, and only that loader's model output will satisfy it. One workflow, three nodes: loader → this → save. Flip load_t2i on in the loader (it's on by default) and you're done.

Install is the same story as the loader - the README's Manager support never materialised, so clone manually and mind the missing requirements:

cd ComfyUI/custom_nodes
git clone https://github.com/leeguandong/ComfyUI_FluxLayerDiffuse.git
pip install diffusers transformers accelerate safetensors opencv-python-headless huggingface_hub

The part you'll actually hit

Everything that's wrong with the pack lands on this node first. The loader's TransparentVAE(None, ...) bug means the whole thing dies at model load with 'NoneType' object has no attribute 'to' - a real r/comfyui report from April 2025, still unfixed, still in the live repo. The node also hardcodes torch.Generator("cuda"), so this is CUDA-only: no Apple Silicon, no CPU mode. And it's heavy - a full bf16 FLUX.1-dev load is a 24GB+ VRAM affair, plus the base model is gated on HuggingFace so you need to accept the license and log in.

Bottom line: when it runs, this is the cleanest alpha you'll get out of Flux, because the transparency was never reconstructed. But it's a one-man wrapper that hasn't moved since March 2025 and crashes before the prompt. Tinker with it as a proof of concept, and keep BiRefNet handy for the production work.

Categoryflux_transparent

Inputs (7)

NameTypeDefaultDescription
modelMODEL
promptSTRINGglass bottle, high quality
guidance_scaleFLOAT3.50–10
num_inference_stepsINT501–100
widthINT102464–2048
heightINT102464–2048
seedINT111110–2147483647

Outputs (1)

NameTypeDescription
imageIMAGE