SCAIL Auto Prompt Builder V2 (Target + MultiRef JSON)
Pick the target, throw in more references, get JSON
- face_reference_image
- video_frames
- body_3_4_reference_image
- body_front_reference_image
- body_back_reference_image
- extra_reference_image
- prompt
- diagnostics
- task_json
- negative_prompt
- input_frames
- planned_output_frames
- render_plan
The plain SCAIL Auto Prompt Builder assumes you're replacing "the main subject" with one reference and writes one prompt. That's fine for a single person in a clean clip. The moment your video has two people, or the character turns and you lose the face, or you want to swap an outfit instead of a person, you're back to hand-editing prose. V2 is the version for those cases: it lets you say who to replace, takes up to five reference images in a defined order, and asks the VLM for structured JSON instead of a single free-form paragraph.
How it works
The reference images are fed in a specific, fixed order - face close-up, body 3/4, body front, body back, optional extra - followed by three sampled video frames. The node tells the VLM what each slot is for: face close-up for facial identity, 3/4 for volume and silhouette, front for proportions and outfit, back for the rear view you'll lose on turns. The model returns strict JSON with task_mode, target_subject, reference_identity, replace, preserve, avoid, a final positive_prompt, a generated negative_prompt, and confidence_notes. The node parses that JSON and spills it out as separate outputs. If the VLM's JSON won't parse, it falls back to a structured template (check diagnostics), and it still auto-calculates the render plan from your frame count - the 4n+1 frame padding SCAIL wants, chunk breakdown at 81 frames with 5-frame overlap, and a note on how to actually preview.
The inputs that earn their keep
target_selection- the one you'll actually edit. "woman on the left," "person #2 in red shirt," "foreground dog." This is the whole upgrade over V1.task_mode-character_replacement(default),face_identity_replacement,outfit_replacement, orobject_replacement. Background replacement is deliberately not an option.face_reference_image- required. This is the identity anchor.body_3_4_reference_image,body_front_reference_image,body_back_reference_image,extra_reference_image- all optional. In the pack's example workflows, the body-front view is the one routed onward as the main SCAIL reference for the SAM mask and CLIPVision path.device- note the default here iscuda, notcpulike V1. Keepunload_after=Trueso the VLM frees VRAM before video generation.
Seven outputs: prompt and negative_prompt (STRINGs for your positive and negative CLIPTextEncode), task_json (the full structured plan, handy to eyeball or log), input_frames and planned_output_frames (INTs), render_plan (a STRING describing the chunking), and diagnostics.
The multi-reference trap
The README is refreshingly honest about this: extra references are not a guaranteed improvement. SCAIL can accept a batch of reference images, but "large/unclear stacks can hurt placement/quality." A single clean body/front reference is the recommended default; add the face and back views only when the clip actually needs them - turns, rear views, identity drift. That aligns with the wider lesson in the KB: identity consistency across a moving character is exactly where every method wobbles, and SCAIL-2's own weak spot is face consistency and cross-chunk drift on longer clips (see the SCAIL-2 panel in the KB). V2 writes a better brief for the model; it doesn't cancel the model's limits.
Install and gotchas
Same pack, same install as the rest of this family - ComfyUI Manager search "SCAIL Auto Prompt Builder," or clone https://github.com/klimentiy23/scail-auto-prompt-builder into ComfyUI/custom_nodes and restart. It needs a local Qwen3-VL-2B-Instruct (or similar) under <models>/LLM, set via COMFYUI_MODELS_DIR on non-Windows machines. No downloads, no API. The node only writes text - the actual long-video chunking is done by the companion SCAIL Auto Extend node, so don't expect planned_output_frames to be rendered by this node alone. If the JSON output ever looks off, that's the 2B VLM misreading a busy frame; raise temperature a notch or sharpen target_selection, and always preview before a full render.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| face_reference_image | IMAGE | — | |
| video_frames | IMAGE | — | |
| task_mode | COMBO | character_replacement | 4 options: character_replacement, face_identity_replacement, outfit_replacement, object_replacement |
| target_selection | STRING | main foreground subject | — |
| user_hint | STRING | — | |
| model_folder | COMBO | Qwen-VL/Qwen3-VL-2B-Instruct | 1 options: Qwen-VL/Qwen3-VL-2B-Instruct |
| device | COMBO | cuda | 2 options: cpu, cuda |
| max_side | INT | 768256–1536 | — |
| max_new_tokens | INT | 900128–2000 | — |
| temperature | FLOAT | 0.150–1.2 | — |
| unload_after | BOOLEAN | true | — |
| fail_mode | COMBO | fallback_template | 2 options: fallback_template, raise_error |
| body_3_4_reference_imageopt | IMAGE | — | |
| body_front_reference_imageopt | IMAGE | — | |
| body_back_reference_imageopt | IMAGE | — | |
| extra_reference_imageopt | IMAGE | — |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| diagnostics | STRING | — |
| task_json | STRING | — |
| negative_prompt | STRING | — |
| input_frames | INT | — |
| planned_output_frames | INT | — |
| render_plan | STRING | — |