moose commited on
Commit
593798f
·
1 Parent(s): efe093f

Revert "Preserve input image aspect ratio when sliders are at default"

Browse files

This reverts commit efe093f967e923c5779f38f59bf90fde2afeb737.

Files changed (1) hide show
  1. app.py +2 -11
app.py CHANGED
@@ -217,17 +217,8 @@ def infer(
217
  except Exception:
218
  continue
219
 
220
- # If user left the sliders at their default minimum, derive output dimensions
221
- # from input image 1 so the result preserves its aspect ratio. Round to the
222
- # nearest multiple of 8 (the pipeline's required dimension step) and clamp
223
- # to the slider's [256, 2048] range.
224
- if height == 256 and width == 256:
225
- if pil_images:
226
- ref_w, ref_h = pil_images[0].size
227
- width = max(256, min(2048, (ref_w // 8) * 8))
228
- height = max(256, min(2048, (ref_h // 8) * 8))
229
- else:
230
- height, width = None, None
231
  print(f"Calling pipeline with prompt: '{prompt}'")
232
  print(f"Negative Prompt: '{negative_prompt}'")
233
  print(f"Seed: {seed}, Steps: {num_inference_steps}, Guidance: {true_guidance_scale}, Size: {width}x{height}")
 
217
  except Exception:
218
  continue
219
 
220
+ if height==256 and width==256:
221
+ height, width = None, None
 
 
 
 
 
 
 
 
 
222
  print(f"Calling pipeline with prompt: '{prompt}'")
223
  print(f"Negative Prompt: '{negative_prompt}'")
224
  print(f"Seed: {seed}, Steps: {num_inference_steps}, Guidance: {true_guidance_scale}, Size: {width}x{height}")