pcuenq HF staff commited on
Commit
409a5b8
1 Parent(s): 46f091b

Fix img2img with 1 step

Browse files

Fixes #1.

Ideally, we should expose in the UI that one step only works with `strength` equal to `1`.

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,