dimension fix

This commit is contained in:
Pablerdo
2025-04-19 03:03:56 -04:00
parent ed580f9d2b
commit 2869ea3a42
+13 -2
View File
@@ -1288,8 +1288,19 @@ class SVCFly:
render_dir = osp.join(WORK_DIR, render_name)
os.makedirs(render_dir, exist_ok=True)
# Convert from ComfyUI format (BCHW) to the format needed by the renderer (BHWC)
input_imgs = rearrange(images, "b c h w -> b h w c")
# Check input format and convert if needed
print(f"Input image tensor shape: {images.shape}")
# Detect if images are already in BHWC format (common with external tools)
if len(images.shape) == 4 and images.shape[3] == 3 and images.shape[1] > 16 and images.shape[2] > 16:
print("Images already in BHWC format, no need to rearrange")
input_imgs = images # Already in BHWC format
else:
# Convert from ComfyUI format (BCHW) to the format needed by the renderer (BHWC)
print("Converting from BCHW to BHWC format")
input_imgs = rearrange(images, "b c h w -> b h w c")
print(f"Processed image shape for rendering: {input_imgs.shape}")
# Save images to disk temporarily (DUST3R needs file paths)
img_paths = []