srface commited on
Commit
3e98216
1 Parent(s): 9a03a2a

Fix image2image

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -72,16 +72,14 @@ def txt_to_img(prompt, neg_prompt, guidance, steps, width, height, generator):
72
  def img_to_img(prompt, neg_prompt, img, strength, guidance, steps, width, height, generator):
73
 
74
  ratio = min(height / img.height, width / img.width)
75
- img = img.resize((int(img.width * ratio), int(img.height * ratio)), Image.LANCZOS)
76
  result = pipe_i2i(
77
  prompt,
78
  negative_prompt = neg_prompt,
79
- init_image = img,
80
  num_inference_steps = int(steps),
81
  strength = strength,
82
  guidance_scale = guidance,
83
- width = width,
84
- height = height,
85
  generator = generator)
86
 
87
  return replace_nsfw_images(result)
 
72
  def img_to_img(prompt, neg_prompt, img, strength, guidance, steps, width, height, generator):
73
 
74
  ratio = min(height / img.height, width / img.width)
75
+ img = img.resize((int(img.width * ratio), int(img.height * ratio)), Image.Resampling.LANCZOS)
76
  result = pipe_i2i(
77
  prompt,
78
  negative_prompt = neg_prompt,
79
+ image = img,
80
  num_inference_steps = int(steps),
81
  strength = strength,
82
  guidance_scale = guidance,
 
 
83
  generator = generator)
84
 
85
  return replace_nsfw_images(result)