Spaces:
Running
on
Zero
Running
on
Zero
Update inference_i2mv_sdxl.py
Browse files- inference_i2mv_sdxl.py +12 -0
inference_i2mv_sdxl.py
CHANGED
@@ -187,12 +187,24 @@ def run_pipeline(
|
|
187 |
control_images = ((plucker_embeds + 1.0) / 2.0).clamp(0, 1)
|
188 |
|
189 |
# Prepare image
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
reference_image = Image.open(image) if isinstance(image, str) else image
|
|
|
|
|
191 |
if remove_bg_fn is not None:
|
|
|
192 |
reference_image = remove_bg_fn(reference_image)
|
193 |
reference_image = preprocess_image(reference_image, height, width)
|
194 |
elif reference_image.mode == "RGBA":
|
|
|
195 |
reference_image = preprocess_image(reference_image, height, width)
|
|
|
|
|
196 |
|
197 |
pipe_kwargs = {}
|
198 |
if seed != -1 and isinstance(seed, int):
|
|
|
187 |
control_images = ((plucker_embeds + 1.0) / 2.0).clamp(0, 1)
|
188 |
|
189 |
# Prepare image
|
190 |
+
# reference_image = Image.open(image) if isinstance(image, str) else image
|
191 |
+
# if remove_bg_fn is not None:
|
192 |
+
# reference_image = remove_bg_fn(reference_image)
|
193 |
+
# reference_image = preprocess_image(reference_image, height, width)
|
194 |
+
# elif reference_image.mode == "RGBA":
|
195 |
+
# reference_image = preprocess_image(reference_image, height, width)
|
196 |
reference_image = Image.open(image) if isinstance(image, str) else image
|
197 |
+
logging.info(f"Initial reference_image mode: {reference_image.mode}")
|
198 |
+
|
199 |
if remove_bg_fn is not None:
|
200 |
+
logging.info("Using remove_bg_fn")
|
201 |
reference_image = remove_bg_fn(reference_image)
|
202 |
reference_image = preprocess_image(reference_image, height, width)
|
203 |
elif reference_image.mode == "RGBA":
|
204 |
+
logging.info("Image is RGBA, preprocessing directly")
|
205 |
reference_image = preprocess_image(reference_image, height, width)
|
206 |
+
|
207 |
+
logging.info(f"Final reference_image mode: {reference_image.mode}")
|
208 |
|
209 |
pipe_kwargs = {}
|
210 |
if seed != -1 and isinstance(seed, int):
|