Saltar al contenido

How it works · Working knowledge

Wan 2.1 transparent animated WebP: mechanisms and practical controls

Produce an animated WebP with generated RGB and alpha. Start with the selected recipe's 832 × 480 pixels, 33 frames, batch size 1 and 16 FPS: approximately 2.06 seconds of playback.

Use this recipe to create a new transparent animation from text, not to remove the background from an existing image or video.

Input: textOutput: imageComfyUI

Before you start

  • Video prompt: Describe subject, movement, framing and style, and request a transparent background.
  • Negative prompt: Unwanted content and artifacts; the recipe supplies a Chinese default list.

Start with one short transparent animation

Open Wan 2.1 transparent animated WebP, artifact version 0.1.6. Keep the starting configuration at 832 × 480 pixels, 33 frames, batch size 1 and 16 playback FPS. No uploaded image is required. The supplied girl-blowing-bubbles prompt is an editable example, not an executed result.

The named output is output:80: node 80 (SaveAnimatedWEBP) saves the RGBA image batch supplied by node 86 output slot 0. Use a viewer or compositor supporting animated WebP and alpha; this is not MP4. Review subject edges and fine details before compositing.

The retained task classification is remove_background, but the actual workflow generates new video frames and alpha from text. That classification does not establish an existing-video cutout tool, background replacement, or preservation of an uploaded subject. Although interface metadata labels some inputs as video sources, prompt is text and frames is a count in this graph.

  1. Replace the supplied example with your subject, movement, framing and visual style; include a request for a transparent background.

    Look for: Text conditioning for a new animation. The prompt alone does not create alpha; the retained adaptation and decoding path supplies it.

    Outputs: output:80

Keep the paired model files together

The retained loaders select these exact model files and settings:

Node and classModel directory and filenameSaved setting
37, UNETLoaderdiffusion_models/wan2.1_t2v_14B_fp8_scaled.safetensorsweight_dtype: default
38, CLIPLoadertext_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensorstype: wan; device: default
39, VAELoadervae/wan_alpha_2.1_vae_rgb_channel.safetensorsRGB decoder VAE
51, VAELoadervae/wan_alpha_2.1_vae_alpha_channel.safetensorsAlpha decoder VAE
65, LoraLoaderModelOnlyloras/wan_alpha_2.1_rgba_lora.safetensorsstrength_model: 1
59, LoraLoaderModelOnlyloras/lightx2v_T2V_14B_cfg_step_distill_v2_lora_rank64_bf16.safetensorsOptional; bypassed; saved strength_model: 1

Make the required files available to their loaders. The Lightx2v file is needed when enabling its optional stage, not for the documented bypassed configuration.

Only the text encoder has a resolved prerequisite resource identity: provider version 1500927, checksum c3355d30191f1f066b26d93fba017ae9809dce6c627dda5f6a66eaa651204f68. The other five component records retain provider version main but unresolved artifact identities and checksums. Their filenames establish the selections, not immutable artifact verification. The linked text-encoder resource is a model prerequisite, not an executable recipe.

No scoped GPU/RAM capacity, backend/platform support or comparable run timing is established. The preparation record's generic 1024 × 1024 workload is not the saved 832 × 480, 33-frame graph configuration. Node metadata records comfy-core version 0.3.62; it does not establish a tested minimum-version compatibility range.

A loader cannot find its selected model.

The graph selects specific filenames through model loaders; most component artifacts remain unresolved in preparation.

Check: Nodes 37, 38, 39, 51 and 65 supply the default path; node 59 is optional and bypassed.

Match the failing loader to the filename and model directory above. Do not substitute a generic VAE for either paired decoder merely because it loads. For Lightx2v, either supply its file before enabling the stage or retain the documented default bypass.

One sampled latent, separate color and alpha decoders

Node 38 supplies the text encoder to positive node 6 and negative node 7. Their conditioning feeds node 3 (KSampler), along with the empty video latent from node 40 (EmptyHunyuanLatentVideo). The saved model connections are 37 → 59 → 65 → 48 → 3. Node 59 is bypassed by default; node 65 supplies the RGBA adaptation, and node 48 (ModelSamplingSD3) uses shift 5. The class names do not change this into image-to-video or an SD3 generation recipe.

Node 3 output slot 0 feeds both node 8 (VAEDecode, titled RGB VAE Decode) and node 52 (VAEDecode, titled Alpha VAE Decode). They use the distinct VAEs loaded by nodes 39 and 51. Node 52 output slot 0 feeds node 82 (ImageToMask), selecting red, then node 84 (InvertMask). Node 86 (JoinImageWithAlpha) receives image from 8:0 and alpha from 84:0. There is no separate background-removal model or uploaded clip in this path.

The retained join implementation bilinearly resizes the incoming mask to the image dimensions, computes one minus that mask, repeats batches as needed, and concatenates alpha with the image's first three channels. With matching dimensions, node 84's inversion and the join's inversion restore the extracted alpha polarity. Keep both operations: feeding the extracted mask directly to the join would change that polarity.

RGB preservation here means the join retains the generated RGB supplied by node 8 at that stage. It does not mean preservation of an original photographed subject or an unconditional guarantee about the encoded file. Generated boundaries and fine details still depend on the sampled content and alpha decoder.

The subject is transparent while the background remains visible.

The join inverts its incoming mask, and the retained graph already includes a preceding inversion. A changed mask path can reverse transparency.

Check: Node 86 alpha is connected to 84:0, after node 82 extracts red from 52:0.

If the graph was modified, restore the retained alpha connections and red-channel selection first. If the path is intact, inspect the generated alpha rather than assuming a wiring defect. RGBA adaptation strength is not an opacity slider.

Choose generated content before playback settings

Width and height bind to node 40 width and height: each is at least 16 and a multiple of 16. Frames binds to native length, using 4n + 1 counts such as 33 or 65. Larger dimensions and more frames increase generation work. Video batch size binds to batch_size (1–4096); retain 1 for one animation because the selected output encodes the resulting image batch rather than offering separate video outputs.

Node 3 sampling defaults are steps 20, cfg 6, sampler_name uni_pc, scheduler simple, and denoise 1. Steps controls denoising iterations (1–10000), not frame count. CFG controls prompt guidance (0–100, step 0.1); excessive values can harm quality. Sampler and scheduler alternatives depend on runtime choices. Keep full denoising for this empty-latent text-to-video path: no uploaded image is present for a lower denoising amount to preserve. The native denoise range is 0–1, step 0.01.

Negative prompt binds to node 7 text; its supplied Chinese list describes unwanted visual qualities. Despite its informal node title, it is connected to the sampler's negative conditioning input. No measured effectiveness for particular terms is established.

Seed has two different retained representations: the interface advertises -1 for randomization, but native node 3 requires a nonnegative value and saves 558449140107503. Its frontend widget also says randomize. Use a fixed nonnegative seed for comparisons and check that the client does not replace it between runs. The exact interface-to-native randomization translation is not supplied; do not write -1 directly into the native input.

RGBA adaptation strength binds to node 65 strength_model, default 1. It changes the model adaptation, not final opacity. Sampling shift binds to node 48 shift, default 5, and changes the noise schedule (0–100, step 0.01). Both LoRA strength inputs allow -100–100, step 0.01; this schema range is not a demonstrated useful operating range.

Generate 65 frames
Adds generated frames, increasing generation work. With batch size 1 and 16 FPS, playback is approximately 4.06 seconds; this is a calculated example, not a measured run.
Use the saved nonnegative seed
Sets the native noise seed for comparisons. Keep client randomization from replacing it; identical results across runtimes are not established.

Do you need additional generated frames or only different playback speed?

  • Additional generated frames: Change Frames using 4n + 1 counts; more frames change the generation workload, without guaranteeing better motion.
  • Different playback speed: Change saver FPS without generating additional frames.Continue

Lightx2v requires a coordinated configuration

Node 59 is optional and saved with mode 4: bypassed. Its exposed Acceleration strength binds to native strength_model, but changing that value has no effect while the stage is bypassed.

To try the documented Lightx2v configuration, first make its exact LoRA file available, enable the stage through the UI, and retain strength 1. Then apply both sampling controls below. Enabling the stage does not automatically change Steps or CFG. Neither control below enables it, and no native enabled input is established. Stage activation is therefore described here rather than represented as a set_input delta.

This is a documented alternate configuration, not evidence of a measured speedup or equivalent output quality. To return to the default path, bypass node 59 and restore both 20 steps and CFG 6; keep the RGBA adaptation at node 65 active with strength 1.

Lightx2v sampling: 4 steps
Use with node 59 enabled at strength 1 and CFG separately set to 1. Four steps alone is not the documented accelerated configuration.
Lightx2v sampling: CFG 1
Pairs with 4 steps and enabled Lightx2v strength 1. Does not enable the LoRA stage or change its strength.

Changing Acceleration strength does nothing.

A bypassed LoRA stage does not apply its strength.

Check: Node 59 is bypassed in the retained configuration.

Keep the bypass with 20 steps and CFG 6, or deliberately enable Lightx2v with its model available and separately set strength 1, 4 steps and CFG 1.

Playback and compression happen after generation

Node 80 receives node 86's RGBA image batch through images. Saved settings are fps 16, lossless true, quality 80, method default, and native filename_prefix ComfyUI. The filename prefix is a real native input but is not one of the exposed recipe interface controls.

FPS accepts 0.01–1000, step 0.01. Playback duration is approximately frames divided by FPS; increasing FPS plays the same generated frames faster rather than adding motion samples.

Lossless avoids lossy color compression. In lossy mode, Quality (0–100) controls detail retention and usually file size; in lossless mode it controls compression effort instead. Keep Compression method at default initially: alternative method values are not retained. Compression settings cannot repair the generated motion or alpha boundaries.

The graph uses ordinary VAEDecode nodes 8 and 52. Neither exposes tile_size, and no tiled-decode adaptation is bound to this recipe. A decode-memory remedy requiring a tiled decoder would be a graph change, not a setting on these nodes.

Play at 8 FPS
With 33 frames and batch size 1, plays the same frames over approximately 4.13 seconds. Adds no generated motion; this is a calculated example.
Use lossy encoding
Makes Quality a detail-retention control rather than lossless compression effort. Compare exported detail and file size rather than assuming a fixed saving.

The animation appears opaque or static in a destination app.

The destination must support both animated WebP and alpha; display limitations can resemble output defects.

Check: The selected saver produces animated WebP, not MP4.

Inspect the exported file in a viewer supporting both features before changing generation settings. If transparency is also wrong there, inspect the alpha path and generated alpha.

Changing Quality does not behave like a visual-quality slider.

Lossless mode uses Quality for compression effort.

Check: Lossless is enabled by default.

Keep lossless for color fidelity, or disable it deliberately before using Quality to trade detail against size.

Memory exhaustion occurs during decoding.

Two ordinary VAE decoders process the sampled video latent; this recipe has no exposed tiled-decode controls.

Check: The failure must be identified at node 8 or 52 rather than inferred from a general out-of-memory message.

Identify the failing stage. Consider smaller width and height in multiples of 16, or fewer frames using 4n + 1 counts, to reduce the workload; no numerical memory saving is established. Do not apply a tile_size delta to either decoder, and do not assume a decode-only change would fix model-loading or sampling failures.

Recipes and setup

umt5_xxl_fp8_e4m3fn_scaled.safetensors

Open this recipe to inspect its current setup.

Where this approach stops

  • Uploaded-image or uploaded-video background removal
  • Background replacement or preservation of uploaded subject pixels
  • MP4 output or separate video outputs for each batch item
  • Guaranteed generated boundaries or pixel-exact preservation through encoding
  • Quantified GPU memory, RAM or generation-time recommendations

Sources