Nodes/ComfyUI-Apt_Preset/AD_scail2_generate_refine
ComfyUI Node

AD_scail2_generate_refine

The cheap second pass that rescues a SCAIL-2 clip

By cardenluo·Created 2 years ago·Updated about 15 hours ago· 334
AD_scail2_generate_refine
  • context
  • stage_info_data2
  • bridge_image
  • segment_video
  • merged_video
fps24
seed0
pixel_refine_modelNone
upscale_output_scale1.00
refine_denoise0.30
latent_sample_tileNone:不分块

SCAIL-2 is the motion-transfer model that dropped the pose skeleton, which is why it can drive a character with a video of an animal and why its outputs look unsettlingly real. It's built on Wan 2.1 and runs 81 frames native in ComfyUI core. What it isn't is fast, or soft - motion transfer tends to come back a little mushy in the fine detail, and re-running the whole thing at higher settings is expensive.

AD_scail2_generate_refine is the cheap fix: it takes the output of a finished SCAIL-2 stage, optionally pushes it through a pixel upscaler, and runs a short low-denoise second diffusion pass over it. Think hi-res fix, but shaped for a motion-transfer pipeline.

How it works, mechanically

The node refuses to guess. Its first act is to look for apt_scail2_refine_state in the incoming context, and if that isn't there it raises an error telling you it needs a context produced by AD_scail2_generate. That state is where the full generated frames, the positive conditioning and the rest of the sampler state live - this node is a continuation, not a standalone upscaler.

From there: if pixel_refine_model is set, it loads that upscaler from your upscale_models folder and applies it to the frames, then resamples to upscale_output_scale if you've asked for something other than 1.0. Then it encodes back to latent and runs a sampler pass at your refine_denoise, with latent_sample_tile optionally chopping the prediction into spatial tiles while keeping the sampler on the complete latent. That last detail is the good kind of clever: tiling the prediction instead of the latent state is what keeps tiled refinement from falling apart into visible squares.

The optional stage_info_data2 (FLOW_STAGE_INFO) is how the node knows which stage of a multi-stage run it's refining. Feed it nothing and it treats itself as a single stage - fine for a one-segment clip, wrong for a pipeline.

The inputs that matter

  • context - required, and must come from AD_scail2_generate. This is the one that trips people up.
  • pixel_refine_model - any model in ComfyUI/models/upscale_models. Defaults to None, which skips pixel upscaling entirely and just does the diffusion refine. Real-ESRGAN x2 or a 4x anime/realism model is the usual pick; this is the "more pixels" rung of upscaling, not the "invent detail" rung.
  • upscale_output_scale - a multiplier applied after the pixel upscaler, so your final factor is the model's factor times this. It's capped at 1.0 here, and the tooltip is explicit that it's ignored when pixel_refine_model is None.
  • refine_denoise - the whole character of the node. Default 0.3 is right: enough to fix texture and sharpen edges, not enough to let the model redraw the motion you just paid for. Push it toward 0.5 and you'll get prettier frames with drifting identity; drop to 0.2 and you're mostly doing an expensive sharpen.
  • latent_sample_tile - leave at None:不分块 unless VRAM forces you. If it does, 推荐:2 | 128 first.

Outputs are bridge_image (an IMAGE, the refined frames - wire it to a preview or a saver), plus segment_video and merged_video. Same convention as the rest of the pack: segment for the piece you're judging, merged for the accumulating whole. Note there's no context output here, so this is the end of the line context-wise - downstream nodes need their own path.

Install, shared with the whole pack

ComfyUI Manager → search Apt_Preset, or:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset
cd ComfyUI-Apt_Preset
pip install -r requirements.txt   # install.bat is Windows-only

Restart ComfyUI. You'll also need the SCAIL-2 weights themselves (Comfy-Org publishes them, and there are community GGUF quants if your card is small), a clip vision model for the generate stage - clip_vision_h.safetensors is the source default, which is a strong hint about what it expects.

Real problems, not invented ones

The error you will actually hit is the context one. People grab this node first because "refine" sounds like a standalone cleanup pass, then wonder why it wants a SCAIL-2 state. It doesn't upscale an arbitrary video.

Second, the VRAM trap: upscaling first means the second pass runs at a much bigger resolution than the first. A refine that OOMs is usually the pixel upscaler's fault, not the sampler's - drop upscale_output_scale, switch the model to a 2x instead of a 4x, and only then start tiling.

Third, expectations. A 0.3-denoise pass at 2x does not create detail that was never there; it resolves what the sampler already implied. If the source is smeared, this pass gives you a clean, confident smear.

CategoryApt_Preset/AD

Inputs (8)

NameTypeDefaultDescription
contextRUN_CONTEXT
fpsFLOAT241–120
seedINT00–18446744073709550000
pixel_refine_modelCOMBONoneOptional pixel upscaler before the refine pass.
upscale_output_scaleFLOAT1.000.1–1Scale applied after pixel upscaling. Ignored when pixel_refine_model is None.
refine_denoiseFLOAT0.300–1
latent_sample_tileCOMBONone:不分块Spatially tile each refine prediction while keeping the complete latent sampler state.
stage_info_data2optFLOW_STAGE_INFO

Outputs (3)

NameTypeDescription
bridge_imageIMAGE
segment_videoVIDEO
merged_videoVIDEO