CS GOP Recompose (anchored bidirectional 4K)
4K recompose that doesn't drift into ghost outlines
- anchor_images
- lq_frames
- flow_fwd
- flow_bwd
- draft_4k
- occlusion_4k
CS Detail Recompose is elegant and it has a known weakness: it drags detail forward from frame 0 for the whole clip, and on long clips that accumulated motion error turns into ghost outlines - texture smeared where the flow slowly went wrong. CS GOP Recompose is the same idea with the drift fixed: it breaks your clip into groups of frames, re-anchors the detail on a keyframe every N frames, and pulls texture from both the previous and next anchor so nothing ever has to travel very far. If your 4K i2v clip is more than a few seconds, this is the node you actually want.
It's one of the seven nodes in CS Hybrid 4K Image-to-Video (lvqunx/comfyui-cs-hybrid), a new pack built on running the video model at 480P and rebuilding 4K detail via optical flow. GOP is the production-grade rebuild stage; think of it as "Detail Recompose, but for adults."
How it works
GOP is the video-codec term for a group of pictures that decodes independently - and that's exactly the design. The clip is split into groups of interval frames (default 8). Each group re-anchors on a keyframe image:
- Pass 1: the anchors are copies of your 4K still, so every group gets fresh, correct texture from the source.
- Pass 2: the anchors are the refined keyframes - the ones you img2img-refined at full resolution and merged back with CS Replace Keyframes. That's the loop that makes long clips stay crisp instead of just non-ghosted.
Within each group, detail is warped from the anchor with forward flow, and - when bidirectional is on (it is by default) - also from the next group's anchor with backward flow. The two contributions are blended by distance from each anchor, and fade (default 0.9) applies an exponential falloff so stale texture yields to the upscaled low-frequency layer rather than ghosting. Lower fade = detail gives up faster; higher = texture tries harder to survive longer distances.
The inputs that matter
- anchor_images - your keyframe batch: the still in pass 1, the refined keyframes in pass 2.
- lq_frames - the low-res generated video.
- flow_fwd / flow_bwd - both flow outputs from CS Flow Estimate. Unlike Detail Recompose, this node needs the backward flow too; that's the price of bidirectional anchoring.
- interval - group size, default 8. Must agree with the
stride/keyframe_everyyou used elsewhere in the pack. - levels, detail_gain - same Laplacian-pyramid controls as Detail Recompose.
- fade - default 0.9, the exponential detail falloff.
- bidirectional - default true. Turn it off for forward-only (slightly cheaper, more drift-prone).
Outputs: draft_4k (the rebuilt frames) and occlusion_4k.
A gotcha worth knowing before you hit it
occlusion_4k here is a placeholder - the source literally returns zeros for it, with a comment saying to use CS Flow Estimate's occlusion MASK for scheduling. So don't wire this node's occlusion output into the tile scheduler; wire the flow node's occlusion output instead. Easy to miss, silently wrong if you do.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/lvqunx/comfyui-cs-hybrid
# restart ComfyUI
Or ComfyUI Manager → search CS Hybrid 4K Image-to-Video. No extra pip dependencies, no model files to fetch beyond the auto-downloaded RAFT weights on the flow node's first run.
Common issues
The recurring theme with every node in this pack is number agreement: interval here must match the stride on CS Batch Stride, the interval on CS Replace Keyframes, and keyframe_every on CS Tile Scheduler. If your refined anchors land on frames that don't line up with the group boundaries, you'll get bands of stale texture instead of clean recompose. And if output looks smeared near group edges, fade is your first dial - it's the node's one real tuning knob.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| anchor_images | IMAGE | — | |
| lq_frames | IMAGE | — | |
| flow_fwd | CS_FLOW | — | |
| flow_bwd | CS_FLOW | — | |
| interval | INT | 82–64 | — |
| levels | INT | 21–4 | — |
| detail_gain | FLOAT | 1.000–2 | — |
| fade | FLOAT | 0.900.5–1 | — |
| bidirectional | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| draft_4k | IMAGE | — |
| occlusion_4k | MASK | — |