Spaces:
Running
on
Zero
Running
on
Zero
fix smol bug in pipeline
Browse files- kontext_pipeline.py +2 -3
kontext_pipeline.py
CHANGED
@@ -939,9 +939,9 @@ class FluxKontextPipeline(
|
|
939 |
# 3. Preprocess image
|
940 |
if not torch.is_tensor(image) or image.size(1) == self.latent_channels:
|
941 |
if isinstance(image, list):
|
942 |
-
|
943 |
else:
|
944 |
-
|
945 |
print("orig width, height:", image_width, image_height)
|
946 |
aspect_ratio = image_width / image_height
|
947 |
if _auto_resize:
|
@@ -954,7 +954,6 @@ class FluxKontextPipeline(
|
|
954 |
image_height = image_height // multiple_of * multiple_of
|
955 |
image = self.image_processor.resize(image, image_height, image_width)
|
956 |
image = self.image_processor.preprocess(image, image_height, image_width)
|
957 |
-
width, height = image_width, image_height
|
958 |
|
959 |
# 4. Prepare latent variables
|
960 |
num_channels_latents = self.transformer.config.in_channels // 4
|
|
|
939 |
# 3. Preprocess image
|
940 |
if not torch.is_tensor(image) or image.size(1) == self.latent_channels:
|
941 |
if isinstance(image, list):
|
942 |
+
image_height, image_width = self.image_processor.get_default_height_width(image[0])
|
943 |
else:
|
944 |
+
image_height, image_width = self.image_processor.get_default_height_width(image)
|
945 |
print("orig width, height:", image_width, image_height)
|
946 |
aspect_ratio = image_width / image_height
|
947 |
if _auto_resize:
|
|
|
954 |
image_height = image_height // multiple_of * multiple_of
|
955 |
image = self.image_processor.resize(image, image_height, image_width)
|
956 |
image = self.image_processor.preprocess(image, image_height, image_width)
|
|
|
957 |
|
958 |
# 4. Prepare latent variables
|
959 |
num_channels_latents = self.transformer.config.in_channels // 4
|