Make uni3c offloading optional

This commit is contained in:
kijai
2025-12-17 16:22:37 +02:00
parent ae6fe0853e
commit 93f7af6dc8
4 changed files with 42 additions and 50 deletions
+2 -8
View File
@@ -888,16 +888,10 @@ class WanVideoSampler:
if uni3c_embeds is not None:
transformer.uni3c_controlnet = uni3c_embeds["controlnet"]
render_latent = uni3c_embeds["render_latent"].to(device)
uni3c_data = uni3c_embeds.copy()
if render_latent.shape != noise.shape:
render_latent = torch.nn.functional.interpolate(render_latent, size=(noise.shape[1], noise.shape[2], noise.shape[3]), mode='trilinear', align_corners=False)
uni3c_data = {
"render_latent": render_latent,
"render_mask": uni3c_embeds["render_mask"],
"camera_embedding": uni3c_embeds["camera_embedding"],
"controlnet_weight": uni3c_embeds["controlnet_weight"],
"start": uni3c_embeds["start"],
"end": uni3c_embeds["end"],
}
uni3c_data["render_latent"] = render_latent
# Enhance-a-video (feta)
if feta_args is not None and latent_video_length > 1: