Make per-clip H3 upscale a Second Pass replacement

This commit is contained in:
2026-10-20 11:02:23 +00:00
parent 497bd84e50
commit 0abde05cef
3 changed files with 36 additions and 15 deletions
+10 -8
View File
@@ -72,14 +72,16 @@ implementation.
### DUMAS H3 Continuum Tiled Latent Upscale (Per Clip) ### DUMAS H3 Continuum Tiled Latent Upscale (Per Clip)
`DumasH3ContinuumTiledLatentUpscalePerClip` applies the native H3 tiled `DumasH3ContinuumTiledLatentUpscalePerClip` is a replacement for the upstream
upscale independently to each physical Continuum clip. It accepts the Second Pass when tiled latent upscale is required. It applies the native H3
Continuum `refine_context` and uses the upstream refine bridge when no direct tiled upscale independently to each physical Continuum clip, passes the
conditioning is connected. Its sampler, scheduler, sigma input, steps, first-pass audio latents through unchanged, and returns the updated assembly
denoise, CFG, and noise seed are separate from the base generation pass. plan plus status. It accepts the Continuum `refine_context` and uses the
Connected sockets take precedence over node defaults. The node preserves one upstream refine bridge when no direct conditioning is connected. Its sampler,
LATENT list item per physical clip to avoid concatenating a long sequence scheduler, sigma input, steps, denoise, CFG, and noise seed are separate from
into one oversized VRAM allocation. the base generation pass. Connected sockets take precedence over node
defaults. The node preserves one LATENT list item per physical clip to avoid
concatenating a long sequence into one oversized VRAM allocation.
The CSGlide `Render Project` control is the generation orchestrator: it renders The CSGlide `Render Project` control is the generation orchestrator: it renders
clips sequentially, adopts each completed render, extracts the previous clip's clips sequentially, adopts each completed render, extracts the previous clip's
+16 -5
View File
@@ -165,6 +165,7 @@ class DumasH3ContinuumTiledLatentUpscalePerClip:
"model": ("MODEL",), "model": ("MODEL",),
"clip": ("CLIP",), "clip": ("CLIP",),
"video_latents": ("LATENT",), "video_latents": ("LATENT",),
"audio_latents": ("LATENT",),
"assembly_plan": ("H3_CONTINUUM_ASSEMBLY_PLAN",), "assembly_plan": ("H3_CONTINUUM_ASSEMBLY_PLAN",),
"refine_context": ("H3_CONTINUUM_REFINE_CONTEXT",), "refine_context": ("H3_CONTINUUM_REFINE_CONTEXT",),
"latent_upscale_param": ("H3_UPSCALE_PARAM",), "latent_upscale_param": ("H3_UPSCALE_PARAM",),
@@ -206,9 +207,9 @@ class DumasH3ContinuumTiledLatentUpscalePerClip:
} }
INPUT_IS_LIST = True INPUT_IS_LIST = True
RETURN_TYPES = ("LATENT", "STRING") RETURN_TYPES = ("LATENT", "LATENT", "H3_CONTINUUM_ASSEMBLY_PLAN", "STRING")
RETURN_NAMES = ("upscaled_video_latents", "report") RETURN_NAMES = ("refined_video_latents", "audio_latents", "updated_assembly_plan", "status")
OUTPUT_IS_LIST = (True, False) OUTPUT_IS_LIST = (True, True, False, False)
FUNCTION = "upscale" FUNCTION = "upscale"
CATEGORY = "Dumas/MiniMax H3/Upscale" CATEGORY = "Dumas/MiniMax H3/Upscale"
@@ -217,6 +218,7 @@ class DumasH3ContinuumTiledLatentUpscalePerClip:
model, model,
clip, clip,
video_latents, video_latents,
audio_latents,
assembly_plan, assembly_plan,
refine_context, refine_context,
latent_upscale_param, latent_upscale_param,
@@ -354,12 +356,21 @@ class DumasH3ContinuumTiledLatentUpscalePerClip:
f"clip {index}: {tuple(samples.shape)} -> {tuple(output_samples.shape)}" f"clip {index}: {tuple(samples.shape)} -> {tuple(output_samples.shape)}"
) )
audio_outputs = _clips(audio_latents)
if len(audio_outputs) != len(outputs):
raise ValueError(
"audio_latents must contain one first-pass audio latent per physical clip"
)
update_geometry = _continuum_helper("update_second_pass_geometry")
updated_plan = update_geometry(_one(assembly_plan, "assembly_plan"), outputs)
return ( return (
outputs, outputs,
"H3 Continuum per-clip tiled upscale; " audio_outputs,
updated_plan,
"H3 Continuum per-clip tiled upscale replacement; "
f"clips={len(outputs)}, sampler={sampler_name}, scheduler={scheduler_name}, " f"clips={len(outputs)}, sampler={sampler_name}, scheduler={scheduler_name}, "
f"steps={steps}, denoise={denoise:g}, cfg={cfg:g}, seed_base={seed}; " f"steps={steps}, denoise={denoise:g}, cfg={cfg:g}, seed_base={seed}; "
+ "; ".join(reports), "audio=first-pass passthrough; " + "; ".join(reports),
) )
+10 -2
View File
@@ -90,6 +90,7 @@ class H3NodeTests(unittest.TestCase):
def test_per_clip_upscale_uses_connected_sigmas(self): def test_per_clip_upscale_uses_connected_sigmas(self):
original = UPSCALE._native_node original = UPSCALE._native_node
original_helper = UPSCALE._continuum_helper
FakeUpscale.calls = [] FakeUpscale.calls = []
UPSCALE._native_node = lambda name: { UPSCALE._native_node = lambda name: {
"MMH3UltimateUpscale": FakeUpscale, "MMH3UltimateUpscale": FakeUpscale,
@@ -97,12 +98,16 @@ class H3NodeTests(unittest.TestCase):
"KSamplerSelect": FakeSampler, "KSamplerSelect": FakeSampler,
"BasicScheduler": FakeScheduler, "BasicScheduler": FakeScheduler,
}.get(name) }.get(name)
UPSCALE._continuum_helper = lambda name: (
lambda plan, latents: {**plan, "updated": True}
)
try: try:
node = UPSCALE.DumasH3ContinuumTiledLatentUpscalePerClip() node = UPSCALE.DumasH3ContinuumTiledLatentUpscalePerClip()
outputs, report = node.upscale( outputs, audio, plan, report = node.upscale(
model=["model"], clip=["clip"], model=["model"], clip=["clip"],
video_latents=[{"samples": FakeSamples((1, 16, 85, 48, 84))}], video_latents=[{"samples": FakeSamples((1, 16, 85, 48, 84))}],
assembly_plan=["plan"], refine_context=["context"], audio_latents=[{"audio": "first-pass"}],
assembly_plan=[{"plan": True}], refine_context=["context"],
latent_upscale_param=["upscale"], spatial_split_param=["spatial"], latent_upscale_param=["upscale"], spatial_split_param=["spatial"],
upscale_sampler=["euler"], upscale_scheduler=["simple"], upscale_sampler=["euler"], upscale_scheduler=["simple"],
upscale_steps=[3], upscale_denoise=[0.2], upscale_cfg=[1.0], upscale_steps=[3], upscale_denoise=[0.2], upscale_cfg=[1.0],
@@ -110,10 +115,13 @@ class H3NodeTests(unittest.TestCase):
upscale_sigmas=["connected-sigmas"], upscale_sigmas=["connected-sigmas"],
) )
self.assertEqual(len(outputs), 1) self.assertEqual(len(outputs), 1)
self.assertEqual(audio, [{"audio": "first-pass"}])
self.assertTrue(plan["updated"])
self.assertEqual(FakeUpscale.calls[0]["sigmas"], "connected-sigmas") self.assertEqual(FakeUpscale.calls[0]["sigmas"], "connected-sigmas")
self.assertIn("clips=1", report) self.assertIn("clips=1", report)
finally: finally:
UPSCALE._native_node = original UPSCALE._native_node = original
UPSCALE._continuum_helper = original_helper
if __name__ == "__main__": if __name__ == "__main__":