radames commited on
Commit
a7d4e24
1 Parent(s): 09ef386

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -12,6 +12,7 @@ import numpy as np
12
  import gradio as gr
13
  import psutil
14
  import time
 
15
 
16
  SAFETY_CHECKER = os.environ.get("SAFETY_CHECKER", None)
17
  TORCH_COMPILE = os.environ.get("TORCH_COMPILE", None)
@@ -78,8 +79,10 @@ 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
- if steps == 1:
82
- strength = 1.0
 
 
83
  results = i2i_pipe(
84
  prompt=prompt,
85
  image=init_image,
 
12
  import gradio as gr
13
  import psutil
14
  import time
15
+ import math
16
 
17
  SAFETY_CHECKER = os.environ.get("SAFETY_CHECKER", None)
18
  TORCH_COMPILE = os.environ.get("TORCH_COMPILE", None)
 
79
  init_image = resize_crop(init_image)
80
  generator = torch.manual_seed(seed)
81
  last_time = time.time()
82
+
83
+ if int(steps * strength) < 1:
84
+ steps = math.ceil(1 / max(0.10, strength))
85
+
86
  results = i2i_pipe(
87
  prompt=prompt,
88
  image=init_image,