[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-92998":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":12,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":16,"rankGlobal":9,"rankLanguage":9,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":9,"pushedAt":9,"updatedAt":22,"readmeContent":23,"aiSummary":24,"trendingCount":15,"starSnapshotCount":15,"syncStatus":12,"lastSyncTime":25,"discoverSource":26},92998,"scail-auto-extend","Brobert-in-aus\u002Fscail-auto-extend","Brobert-in-aus","ComfyUI custom node: generate SCAIL-2 videos of any length in one queue - automatic chunking, anchoring, color matching, and stitching",null,"Python",54,2,51,1,0,41.63,"MIT License",false,"main",true,[],"2026-07-22 04:02:07","# SCAIL Auto Extend\n\nA ComfyUI custom node that generates SCAIL-2 videos of any length in a single queue. It automatically splits generation into chunks (the model's limit is 81 frames), anchors each chunk on the last frames of the previous one, color-matches to prevent drift, and stitches the result — no manual extension sections, bypassing, or frame math.\n\n## Examples\n\n📥 **[Download the example workflow — `SCAIL Auto Extend V3.json`](https:\u002F\u002Fgithub.com\u002FBrobert-in-aus\u002Fscail-auto-extend\u002Fraw\u002Fmain\u002FSCAIL%20Auto%20Extend%20V3.json)** (right-click → Save As, or drag it into ComfyUI).\n\nhttps:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fee4ea6c3-a1ca-47ce-9fe0-537cb69b431f\n\nhttps:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fc3a18739-da55-408e-8903-51757cc6530e\n\nhttps:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F59d71f7b-8892-4457-87cd-9a94043ba287\n\n## What it does\n\nSCAIL-2 generates at most 81 frames per pass. Longer videos require extension passes where the first 5 frames are anchored to the last 5 frames of the previous chunk, so each extension only contributes 76 new frames — and the final chunk length depends on the input video. Doing this by hand means duplicated node sections, manual bypassing, and recalculating the last chunk for every video.\n\nThe **SCAIL Auto Extend Sampler** node does the whole loop internally at runtime:\n\n1. Reads the pose video length (controlled as usual by your video loader's force_rate \u002F skip \u002F frame cap), trimmed to the nearest 4n+1 frames.\n2. Plans the chunks: 81, then 81 (76 new + 5 overlap) repeating, with an automatically sized final chunk. E.g. 197 frames → 81 + 81 + 45.\n3. For each chunk: builds the SCAIL-2 conditioning, samples, decodes, and (optionally) Reinhard-LAB color-matches the new frames to the last frame of the previous chunk.\n4. Stitches everything and outputs the full image batch plus a frame count.\n\nIt calls ComfyUI's own `WanSCAILToVideo`, `SamplerCustom`, and `ColorTransfer` implementations internally, so output is identical to the equivalent hand-built chain.\n\n## Requirements\n\n- ComfyUI with the SCAIL-2 nodes (merged June 2026 — update to a recent ComfyUI)\n- SCAIL-2 models: https:\u002F\u002Fhuggingface.co\u002FComfy-Org\u002FSCAIL-2\u002Ftree\u002Fmain\u002Fdiffusion_models\n\nThe bundled example workflows additionally use:\n\n- [ComfyUI-VideoHelperSuite](https:\u002F\u002Fgithub.com\u002FKosinkadink\u002FComfyUI-VideoHelperSuite) (video load\u002Fcombine)\n- [ComfyUI-KJNodes](https:\u002F\u002Fgithub.com\u002Fkijai\u002FComfyUI-KJNodes) (resize, Set\u002FGet, model loader)\n- [ComfyUI-SAM3](https:\u002F\u002Fgithub.com\u002FPozzettiAndrea\u002FComfyUI-SAM3) (person tracking for the colored masks)\n- [ComfyUI_essentials](https:\u002F\u002Fgithub.com\u002Fcubiq\u002FComfyUI_essentials) (GetImageSize+)\n- [ComfyUI-RMBG](https:\u002F\u002Fgithub.com\u002F1038lab\u002FComfyUI-RMBG) (background removal on the reference image — V3 workflow)\n\n> **RMBG is optional and swappable.** Removing the reference image's background and padding it to the video's aspect ratio helps the model produce cleaner replacements, but you can replace the RMBG node with any background-removal node you prefer, feed a reference image whose background is already removed, or skip background removal entirely and see how it goes.\n\n## Installation\n\n```\ncd ComfyUI\u002Fcustom_nodes\ngit clone https:\u002F\u002Fgithub.com\u002FBrobert-in-aus\u002Fscail-auto-extend\n```\n\nRestart ComfyUI. The nodes appear as **SCAIL Auto Extend Sampler** (`sampling\u002Fvideo`), plus **SCAIL-2 Identity Tracker**, **SCAIL-2 Identity Seeder** and **SCAIL-2 Multi-Reference (experimental)** (`conditioning\u002Fvideo_models\u002Fscail`) for multi-person work.\n\n## Usage\n\nLoad the included workflow: [`SCAIL Auto Extend V3.json`](https:\u002F\u002Fgithub.com\u002FBrobert-in-aus\u002Fscail-auto-extend\u002Fraw\u002Fmain\u002FSCAIL%20Auto%20Extend%20V3.json) (direct download — right-click → Save As, or drag the file into ComfyUI) — input video + reference image in, finished video out.\n\nOr wire the node into your own workflow in place of your sampler section:\n\n| Input | Connect from |\n|---|---|\n| model | your model chain (e.g. ModelSamplingSD3) |\n| positive \u002F negative | CLIPTextEncode |\n| vae | VAELoader |\n| sampler \u002F sigmas | KSamplerSelect \u002F BasicScheduler |\n| pose_video | your (resized) driving video |\n| pose_video_mask | SCAIL2ColoredMask → pose_video_mask |\n| reference_image | reference image |\n| reference_image_mask | SCAIL2ColoredMask → reference_image_mask |\n| clip_vision_output | CLIPVisionEncode |\n| width \u002F height | generation resolution |\n\nOutputs: `images` (stitched batch → VHS_VideoCombine) and `frame_count`.\n\n### Options\n\n| Option | Default | Description |\n|---|---|---|\n| chunk_length | 81 | Max frames per chunk (model limit). Must be 4n+1. |\n| overlap | 5 | Anchor frames carried between chunks. SCAIL-2 was trained at 5. |\n| seed_mode | increment | `increment`: chunk i uses noise_seed + i. `fixed`: same seed every chunk. |\n| color_transfer | true | Reinhard-LAB match of each chunk to the previous chunk's last frame (fights color drift). |\n| pose_strength \u002F pose_start \u002F pose_end | 1.0 \u002F 0.0 \u002F 1.0 | Pose conditioning strength and active step range. |\n| replacement_mode | true | SCAIL-2 replacement vs animation mode (must match your mask setup). |\n\n### Notes\n\n- Total length is driven by however many frames reach `pose_video` — cap or trim at your video loader. Input is trimmed to the nearest 4n+1 frames (loses at most 3).\n- Progress is reported per chunk; the console logs the chunk plan, e.g. `[SCAIL Auto Extend] 197 pose frames -> 197 output frames, 3 chunk(s): [81, 81, 45]`.\n- Interrupting cancels cleanly between\u002Fduring chunks.\n\n## Multi-person replacement\n\nReplace several people in the driving video, each with a different character from a single composited reference image. Three helper nodes (`conditioning\u002Fvideo_models\u002Fscail`):\n\n- **SCAIL-2 Identity Tracker** — an interactive canvas that outputs `ref_track_data` + `driving_track_data` for **Create SCAIL-2 Colored Mask**. It's an output node, so it gets a ▶ play button (step 2 below). Per side (Reference \u002F Driving tabs):\n  - **Box** mode (default, most reliable): drag a box per person; boxes are selectable, draggable and resizable.\n  - **Point** mode: click = new identity, **Shift+click** adds a positive point, **Alt+click** a negative one. Use 2+ points to capture a whole person — a single click tends to grab only the part under it (a shirt, a face).\n  - **Right-click** removes a box \u002F a single point (or the identity if it was its last point); **Delete** removes the selected one.\n  - Optional **text detection**: wire a `CLIPTextEncode` (\"person\") into `reference_conditioning` and\u002For `driving_conditioning`. With `auto_detect` on, text *adds* identities beyond your boxes — up to 6 on the reference, up to the reference box count on the driving side (caps are ceilings, not quotas; it only adds people it actually detects). With no boxes at all, this reproduces the V1 text-only flow.\n  - With `auto_detect` **off** and fewer reference than driving subjects, a warning appears below the preview (some driving people would have no reference to map to).\n- **SCAIL-2 Identity Seeder** — a headless variant that takes point\u002Fbox coordinates and outputs per-person masks for `SAM3_VideoTrack`'s `initial_mask`.\n- **SCAIL-2 Multi-Reference (experimental)** — feeds each identity as a separate reference frame. It binds by colour (position-independent) but the model blends appearances, so it's not recommended for quality — see [Findings](#findings).\n\nThe [`SCAIL Auto Extend V3.json`](https:\u002F\u002Fgithub.com\u002FBrobert-in-aus\u002Fscail-auto-extend\u002Fraw\u002Fmain\u002FSCAIL%20Auto%20Extend%20V3.json) workflow wires the Identity Tracker end to end.\n\n### Workflow (Identity Tracker)\n\n1. Feed the **processed** reference image (background removed + padded to the video's aspect ratio) into `reference_image`, the resized pose video into `pose_video`, a SAM3 model into `sam3_model`. Optionally wire `CLIPTextEncode` into `reference_conditioning` \u002F `driving_conditioning` for text detection.\n2. **Prepare the canvas (partial execution).** Press the node's **▶ play button** — *Queue Selected Output Nodes* runs the graph **only up to this node**, rendering the reference and driving frames onto the canvas without running the sampler. (Background removal \u002F padding must sit upstream so the canvas shows the exact pixels the model will see, and your masks line up.)\n3. Mark each person on the **Reference** tab, then the **Driving** tab — boxes (recommended) or multi-point identities. Marker order = colour order.\n4. On **Create SCAIL-2 Colored Mask**, set **`sort_by = left_to_right`** so both sides colour by position (see [Findings](#findings) for why).\n5. Queue the workflow normally.\n\nSee [Findings](#findings) for how identity mapping actually behaves and where it breaks.\n\n## License\n\nMIT\n\n## Findings\n\nNotes from working out how SCAIL-2 handles multi-identity replacement, recorded so they aren't re-discovered the hard way.\n\n- **Routing is position-first, not colour-first.** With a single composited reference frame, the model assigns reference characters to driving people by **spatial position**; the colour mask's real job is *temporal consistency* (pinning identities frame to frame), not initial assignment. So control who-becomes-whom by **ordering the reference composite left-to-right** to match the driving people, and set `SCAIL2ColoredMask sort_by = left_to_right` so both sides colour by position and the two signals agree. (Mechanism: the reference is concatenated as one extra frame, the colour mask is an additive signal that loses to RoPE positional encoding, and only one reference latent is ever used.)\n- **You can't force colour over position.** Rearranging the reference to break the spatial correspondence (e.g. stacking characters vertically instead of in a row) does **not** override position-first routing — tested, no effect.\n- **Multi-reference binds by colour but blends appearance.** Feeding each identity as its own reference frame (the experimental Multi-Reference node) *does* make binding colour-driven and position-independent — but the model can't keep the appearances apart and blends them across characters. Correct routing, degraded fidelity; matches the model card's \"not optimized for multi-reference.\" Kept as a documented dead end.\n- **Max 6 identities.** The model was trained on a fixed 6-colour palette; a 7th wraps and collides.\n- **Constant subject count.** The model expects the driving people present to correspond to the reference. People **entering or leaving mid-shot** produce artifacts — it tries to realise all reference identities from the start, cramming\u002Fhallucinating. Split the clip at the entrance\u002Fexit and render each segment with a reference of only the people present, then concatenate.\n- **Crossings & occlusion are the weak point.** Identity is held over time only by the per-frame tracked colour mask (the reference is static), so when people cross or one passes in front of another it can break in two places: the model's position-first routing momentarily points each person at the *other's* reference region (swap \u002F bleed \u002F flicker), and SAM3's tracker can swap the colour assignment as the masks overlap. Footage where people stay in their lanes is far more reliable. To tell which layer failed, preview `pose_video_mask` through the crossing — swapped colours there mean the tracker; a clean mask but a swapped output means the model.\n- **Resolution must be divisible by 32.** Width and height should be multiples of **32**, not just 16. The pose\u002Fmask conditioning runs at half resolution, so its latent is `dim\u002F16`; with the model's patch size of 2 that has to be even → `dim` divisible by 32. Out-of-spec dimensions get **circular**-padded (`common_dit.pad_to_patch_size`), which wraps the top edge of the frame onto the bottom — the symptom is the bottom ~8–16 px echoing the top. The trap is a multiple of 16-but-not-32: the main latent is clean but the half-res pose latent is odd, so it only shows up at some resolutions. Set your resize node's `divisible_by` to 32 (the bundled workflow does).\n- **Framerate.** SCAIL-2 is a Wan-2.1 model trained at 16 fps. For smoother output, generate at 16 and **interpolate** (e.g. FILM VFI), setting Video Combine's `frame_rate` to the interpolated rate — cheaper than, and truer to the model's cadence than, raising `force_rate` in the loader (which generates proportionally more frames and pushes the model off 16 fps).\n","这是一个为ComfyUI设计的自定义节点，用于自动化生成任意长度的SCAIL-2视频。它通过内部调度实现自动分块（每块最多81帧）、帧锚定（重叠5帧以保证连贯性）、Reinhard-LAB色彩匹配（抑制色偏）及无缝拼接，无需手动构建重复节点链或计算帧偏移。基于ComfyUI原生SCAIL-2节点封装，输出与手工流程完全一致，显著降低长视频生成的操作复杂度。适用于需要稳定、高质量、中长时长（>81帧）人物驱动视频生成的AI内容创作场景，如虚拟人播报、动画延伸与动作复现等。","2026-07-11 02:30:35","CREATED_QUERY"]