EasyKSampler (LayerDiffuse)
Generate images with real transparency
- pipe
- model
- pipe
- final_image
- original_image
- alpha
Most "transparent PNG" workflows are really background-removal: generate a full image, then cut the subject out with a matting model, and you inherit whatever fringe the matte leaves behind. LayerDiffuse (lllyasviel's method) does something different - it generates the transparency natively, so the model produces a proper RGBA image with a real alpha channel, glass and hair and soft edges included. easy kSamplerLayerDiffusion is the Easy-Use sampler that runs a LayerDiffuse workflow and gives you that alpha out the other side.
This is the payoff node for the pack's Layer Diffusion support. It pairs with easy preSamplingLayerDiffusion (which sets up the LayerDiffuse conditioning) the same way the normal sampler pairs with easy preSampling.
How it works
LayerDiffuse patches the diffusion model so it learns to output a transparent layer directly, rather than a flat RGB image you mask afterward. The pre-sampling node applies that patch and settings into the pipe; this sampler runs the diffusion and then splits the result into its visible image and its alpha. Because the transparency is generated, not extracted, you get clean edges on exactly the things background removers choke on - wispy hair, motion blur, semi-transparent glass.
The inputs and outputs that matter
The interesting part of this node is its outputs, not its inputs - the sampling settings all live in the pipe already.
pipe- carries model, prompts, latent and sampler settings fromeasy preSamplingLayerDiffusion. This node reads them; there are no cfg/steps widgets on the node itself.image_output-Preview/Save/Hide/Hide&Save/Sender/Sender&Save, same output-handling menu as the other Easy-Use samplers.save_prefix- filename prefix when saving.- Optional
model- override the pipe's model for this pass.
Outputs are what you're here for:
final_image- the composited RGB image.original_image- the image before the transparency split.alpha- the mask (a list of alpha channels). This is the actual transparency. Combinefinal_image+alphawith a JoinImageWithAlpha-style node, or save through a node that writes RGBA, to get a true transparent PNG.
How to install it
Install the pack via ComfyUI Manager ("ComfyUI Easy Use") or:
cd ComfyUI/custom_nodes
git clone https://github.com/yolain/ComfyUI-Easy-Use
Then install.bat / pip install -r requirements.txt, restart. Preinstalled on comfy.icu. Note from the pack's own README: the first time you use Layer Diffusion you may need to run pip install -r requirements.txt to pull the extra dependencies, and the underlying method is built on ComfyUI-layerdiffusion - the LayerDiffuse model weights get fetched on first run, so give it a moment.
Common issues
Two things trip people up. First, LayerDiffuse is an SD1.5/SDXL-era technique - it's tied to those model families, so don't expect to point it at a Flux or Z-Image checkpoint and get transparency. Match your loader to what LayerDiffuse supports.
Second, the alpha comes out as a separate output for a reason: if you only wire final_image to a save node, you throw the transparency away and save a flat image. You have to carry alpha through to a save path that preserves it. That's the single most common "why is my PNG not transparent" complaint with this workflow - the model did its job, the save node just dropped the channel. And as always, this sampler needs its matching easy preSamplingLayerDiffusion upstream; a plain pre-sampler won't set up the transparency patch.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| pipe | PIPE_LINE | — | |
| image_output | COMBO | Preview | 6 options: Hide, Preview, Save, Hide&Save, Sender, Sender&Save |
| link_id | INT | 00–9223372036854776000 | — |
| save_prefix | STRING | ComfyUI | — |
| modelopt | MODEL | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| pipe | PIPE_LINE | — |
| final_image | IMAGE | — |
| original_image | IMAGE | — |
| alpha | MASK | — |