Update block.py
Browse files
block.py
CHANGED
@@ -54,8 +54,8 @@ class Wan14BImageProcessor(PipelineBlock):
|
|
54 |
max_area = block_state.max_area
|
55 |
|
56 |
aspect_ratio = image.height / image.width
|
57 |
-
mod_value_height =
|
58 |
-
mod_value_width =
|
59 |
height = round(np.sqrt(max_area * aspect_ratio)) // mod_value_height * mod_value_height
|
60 |
width = round(np.sqrt(max_area / aspect_ratio)) // mod_value_width * mod_value_width
|
61 |
resized_image = image.resize((width, height))
|
|
|
54 |
max_area = block_state.max_area
|
55 |
|
56 |
aspect_ratio = image.height / image.width
|
57 |
+
mod_value_height = components.vae_stride[1] * components.patch_size[1]
|
58 |
+
mod_value_width = components.vae_stride[2] * components.patch_size[2]
|
59 |
height = round(np.sqrt(max_area * aspect_ratio)) // mod_value_height * mod_value_height
|
60 |
width = round(np.sqrt(max_area / aspect_ratio)) // mod_value_width * mod_value_width
|
61 |
resized_image = image.resize((width, height))
|