mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-16 03:57:27 +08:00
Add validation for invalid HiDream input dimensions
This commit is contained in:
parent
1f28908d6e
commit
cbcadb3e61
@ -148,6 +148,12 @@ class HiDreamO1Transformer(nn.Module):
|
||||
raise ValueError("HiDreamO1Transformer requires input_ids and position_ids in conditioning")
|
||||
|
||||
B, _, H, W = x.shape
|
||||
|
||||
if H % self.patch_size!=0 or w% self.patch_size!=0:
|
||||
raise ValueError(
|
||||
f"Input dimensions ({H},{W}) must be divisible"
|
||||
f"by patch size{self.patch_size}"
|
||||
)
|
||||
h_p, w_p = H // self.patch_size, W // self.patch_size
|
||||
tgt_image_len = h_p * w_p
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user