MorphGS: Preprocess Video
Turning a Phone Clip Into Multi-View Training Data
- scene_name
- log
Your clip is one camera. MorphGS needs a whole ring of them, consistently across time, because that's how it learns the motion in 3D rather than in screen space. This node is where a normal video becomes that multi-view training set - and it's the noisiest, most failure-prone piece of the pack, because it depends on a whole extra model stack (SV4D/SP4D) that you have to set up first.
What it's doing, in order
First it gets your footage into MorphGS's required shape: a square rgb.mp4, subject centred, consistent scale across the whole clip, pure white background. That's ffmpeg frame extraction, then rembg with the u2net session masking the subject on every frame, then recompositing onto a 1080x1080 white canvas with the subject filling about 90% of the frame. Fair warning straight from docs/knowledge/background-removal.md: u2net is rembg's oldest model and choosing it is what costs you quality on hard edges. It's the pack's choice, not yours - there's no knob for it here.
Then MorphGS's own preprocess_src.py runs SV4D or SP4D multi-view synthesis over that clip and extracts source-side features, landing in demo/processed_videos/<scene_name>/view_0/color/ and friends.
The inputs
video_path is a text field - absolute path, readable by ComfyUI. scene_name is the key the rest of the graph uses; it becomes a directory and half of the experiment name, so keep it slug-safe.
sv4d_mode deserves a second look, because the label undersells it. The dropdown isn't a hardcoded list: at node-graph load the pack asks folder_paths.get_filename_list("checkpoints") for your checkpoints and keeps only the three filenames it knows - sv4d2.safetensors, sv4d2_8views.safetensors, sp4d.safetensors. So it shows you real files you actually have, the same way any checkpoint loader does, and falls back to plain mode names (sv4d, sp4d, sv4d2_8views) when the folder can't be listed. If the selected checkpoint is missing from the pipeline environment but present in ComfyUI's models/checkpoints/, it gets copied across automatically.
already_masked is the one I'd leave alone. Tick it and the masking step isn't "lighter", it's skipped outright with a plain file copy - no ffmpeg, no rembg, no white square, no rescale. Only tick it if you have already produced a properly framed, white-background square clip yourself.
fastmode is on by default and is just forwarded to MorphGS's own preprocess_src.py as --fastmode. The node doesn't interpret it; whatever it means, it means inside MorphGS.
force_reprocess forces both the masking and the synthesis to run again over existing outputs.
Outputs are scene_name (feed it into Train & Render) and log.
Install, and the SV4D prerequisite
Same pack install as the rest of it - Manager search ComfyUI-MorphGS, or:
cd ComfyUI/custom_nodes
git clone https://github.com/Yuvaraj0739X/ComfyUI-MorphGS
The real prerequisite is in the MorphGS environment, not ComfyUI's. You need ffmpeg and ffprobe on PATH inside that env, rembg installed in it, and the extlibs/generative-models clone plus a checkpoint in place - which is what MorphGS: Setup SV4D exists to do. If you skip that, this node fails loudly with "Run MorphGS: Setup SV4D first" rather than limping along, which is the right behaviour.
Where people get burned
The frame count won't be what you think. SV4D synthesises in windows, so a 70-frame source clip can come out as 66 processed frames. This matters because MorphGS normalises per-frame time by the length of the processed sequence, and the Export node later reads view_0/color/ to recover that number. If you ever hand-feed a different or re-cut video for a scene you already processed, the animation timing desyncs from what was trained. Don't re-cut behind a cached scene - use force_reprocess.
rembg missing is a ModuleNotFoundError from a script, not a node-level warning. It has to be in the MorphGS environment specifically; installing it into ComfyUI's Python does nothing for this path.
Long timeouts, silently. The masking step gets 30 minutes and the multi-view pass gets an hour before the subprocess is killed. That's not a lot of headroom for a clip that isn't short. Trim to the motion you actually care about - 5 to 10 seconds is plenty for a motion clip - rather than feeding it a minute of footage and hoping.
Disk. Each processed scene keeps every view as PNG frames. Several scenes at 1080 will eat space quietly, and both the raw and processed copies stick around.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| video_path | STRING | — | |
| scene_name | STRING | my_scene | — |
| already_masked | BOOLEAN | false | — |
| sv4d_mode | COMBO | sv4d | 3 options: sv4d, sv4d2_8views, sp4d |
| fastmode | BOOLEAN | true | — |
| force_reprocess | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| scene_name | STRING | — |
| log | STRING | — |