Fix img2img with 1 step

#2
by pcuenq HF staff - opened
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -78,6 +78,8 @@ async def predict(init_image, prompt, strength, steps, seed=1231231):
78
  init_image = resize_crop(init_image)
79
  generator = torch.manual_seed(seed)
80
  last_time = time.time()
 
 
81
  results = i2i_pipe(
82
  prompt=prompt,
83
  image=init_image,
 
78
  init_image = resize_crop(init_image)
79
  generator = torch.manual_seed(seed)
80
  last_time = time.time()
81
+ if steps == 1:
82
+ strength = 1.0
83
  results = i2i_pipe(
84
  prompt=prompt,
85
  image=init_image,