Nodes/SDXL Auto Prompter/APNext H3 Scene Retake (render one scene again)
ComfyUI Node

APNext H3 Scene Retake (render one scene again)

APNext H3 Scene Retake

By dagthomas·Created 3 years ago·Updated about 23 hours ago· 289
APNext H3 Scene Retake (render one scene again)
  • model
  • clip
  • vae
  • audio_vae
  • sampler
  • sigmas
  • master_audio
  • ref_image_1
  • ref_image_2
  • ref_image_3
  • ref_image_4
  • file_path
  • prompt
  • report
bundlelatest (newest bundle)
scene_number1
seed0
width1344
height768
prompt_override
continuitycontinue from the previous scene's saved take when one exists
context_frames39
audio_feather_ticks8
filename_prefixvideo/H3_retake
fps24.00
context_modemasked AV latent (picture + sound; 39 / 90 / 141 frames)

A finished H3 run has one scene that didn't land - a face drifted, the model ignored the camera move, the cut reads wrong. Your options before this node were miserable: re-queue the whole graph (which re-runs the writer, possibly with a randomising seed, and re-renders every scene - twenty minutes to get back to the one you wanted) or hand-assemble the fix in an editor.

H3SceneRetake reads the run's saved scene bundle, takes one scene number, and renders just that scene with a new seed and - if you like - a rewritten prompt. Its button queues only this node (ComfyUI partial execution), so the writer, the sound nodes and the other scenes never run again. It's a dagthomas/comfyui_dagthomas node, built to sit at the end of the chain-render workflows.

How it works

Every writer in this pack writes its saved scenes to output/apnext_scenes/ (a JSON bundle: prompts, durations, seeds, the works). The node loads that bundle, takes your scene_number, and renders it with seed and prompt_override. The continuity is the clever part: the chain renders also write every scene's sampled latent to output/apnext_latents/<project>_sNN.pt, so a retake of scene 07 pins scene 06's real tail - picture and sound - to its head, exactly as the chain render did. The retaken 07 is then saved as the new tail, so a later retake of 08 continues from your improved 07. You fix the film forward.

The inputs that matter

  • model / clip / vae / audio_vae + sampler / sigmas - the same block the chain render used.
  • bundle - latest always means the newest bundle, so a fresh run needs no browser refresh.
  • scene_number - 1-based, as the writer numbers them.
  • seed - fixed by default so one click is one retake; change it for a fresh take.
  • prompt_override - empty means the scene's prompt from the bundle, unchanged. Anything here replaces it for this take: paste the scene from the H3 Prompt Preview, edit, retake. This is the whole point - surgical re-direction of one scene.
  • continuity - continue from the previous scene's saved take when one exists (default), or hard cut (independent clip).
  • context_frames - what the chain render used; snapped to what context_mode can pin (39 / 90 / 141 for the masked AV latent, any H3 run for the guides).
  • context_mode - masked AV latent (picture + sound; use what the chain render used for films), motion context guide, or core guide clip (picture only).

For music videos, connect master_audio (the whole song) - the scene's piece is cut from it at the bundle's segment and masked into the audio latent, exactly as the render did. Leave it unconnected for a film; H3 then generates the sound, continuing the previous scene's when the take continues. ref_image_1..4 are the same reference pictures the run used.

Outputs: file_path (the new take), prompt (what was actually rendered, so you can verify your override took), and report.

Install

Standard for this pack:

cd ComfyUI/custom_nodes
git clone https://github.com/dagthomas/comfyui_dagthomas
cd comfyui_dagthomas
pip install -r requirements.txt

Then restart ComfyUI (Manager search "comfyui_dagthomas" works too). No extra pack is required for a retake, but for the full picture+sound continuation you want ComfyUI-H3-Motion-Context-MultiRef installed, the same one the chain renders use.

Troubleshooting

The most common error is honest: "No saved scenes yet" - the node can't retake a run that was never saved, so make sure the writer ran with its save_scenes on, and (for continuation) that the chain render had save_latents on. Don't change the writer's seed between the original run and the retake and expect the bundle to still match; latest always points at the newest bundle precisely so you don't have to think about it. If the retaken scene doesn't continue the way you hoped, check context_frames - it has to match what context_mode can actually pin.

Categorycomfyui_dagthomas/H3

Inputs (23)

NameTypeDefaultDescription
modelMODEL
clipCLIP
vaeVAEH3 video VAE.
audio_vaeVAEH3 audio VAE.
samplerSAMPLER
sigmasSIGMAS
bundleCOMBOlatest (newest bundle)The run's saved scenes (output/apnext_scenes/, newest first). `latest` always means the newest bundle, so a fresh run needs no browser refresh.
scene_numberINT11–99Which scene to render again (1-based, as the writer numbers them).
seedINT00–18446744073709550000A new seed = a new take. Fixed by default so a click is one retake.
widthINT134432–8192
heightINT76832–8192
prompt_overrideSTRINGEmpty: the scene's prompt from the bundle, unchanged. Anything here replaces it for this take - paste the scene from the Prompt Preview, edit, retake.
continuityCOMBOcontinue from the previous scene's saved take when one exists2 options: continue from the previous scene's saved take when one exists, hard cut (independent clip)
context_framesINT395–141Pinned run from the previous scene's saved take. Use what the chain render used; snapped to what context_mode can pin (39 / 90 / 141 for the masked AV latent, any H3 run for the guides).
audio_feather_ticksINT80–64Release over the pinned sound's last ticks (40 = 1 s); films only.
filename_prefixSTRINGvideo/H3_retakeWhere the take lands; the scene number and `_retake` are appended.
fpsFLOAT24.001–60
context_modeCOMBOmasked AV latent (picture + sound; 39 / 90 / 141 frames)How the previous take reaches this one - use what the chain render used (films). Music videos always use the masked song path.
master_audiooptAUDIOMusic videos: the whole song (Load Audio). The scene's piece is cut from it at the bundle's segment and masked into the audio latent, as the render did. Leave it unconnected for a film - H3 then generates the sound (continuing the previous scene's when the take continues).
ref_image_1optIMAGEReference picture <Picture 1> (Ref2VA) - the same ones the run used.
ref_image_2optIMAGEReference picture <Picture 2> (Ref2VA) - the same ones the run used.
ref_image_3optIMAGEReference picture <Picture 3> (Ref2VA) - the same ones the run used.
ref_image_4optIMAGEReference picture <Picture 4> (Ref2VA) - the same ones the run used.

Outputs (3)

NameTypeDescription
file_pathSTRING
promptSTRING
reportSTRING