Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -51,7 +51,7 @@ base = "black-forest-labs/FLUX.1-schnell"
|
|
51 |
|
52 |
# variable data
|
53 |
|
54 |
-
|
55 |
|
56 |
# precision data
|
57 |
|
@@ -183,6 +183,7 @@ def pipe_generate(img,p1,p2,time,title):
|
|
183 |
max_sequence_length=seq,
|
184 |
generator=torch.Generator(device).manual_seed(int(str(random.random()).split(".")[1]))
|
185 |
).images[0]
|
|
|
186 |
|
187 |
if title != "":
|
188 |
draw = ImageDraw.Draw(img)
|
@@ -192,6 +193,8 @@ def pipe_generate(img,p1,p2,time,title):
|
|
192 |
x = (width - textwidth) // 2
|
193 |
y = (height - textheight) // 2
|
194 |
draw.text((x, y), title,font=font)
|
|
|
|
|
195 |
|
196 |
if time == 0.0:
|
197 |
return img
|
@@ -209,6 +212,8 @@ def pipe_generate(img,p1,p2,time,title):
|
|
209 |
|
210 |
def handle_generate(*_inp):
|
211 |
|
|
|
|
|
212 |
inp = list(_inp)
|
213 |
|
214 |
inp[1] = translate(inp[1],"english")
|
@@ -242,7 +247,7 @@ def handle_generate(*_inp):
|
|
242 |
if inp[3] == 0.0:
|
243 |
return name, None
|
244 |
else:
|
245 |
-
return
|
246 |
|
247 |
def ui():
|
248 |
global result
|
|
|
51 |
|
52 |
# variable data
|
53 |
|
54 |
+
additional_image = None
|
55 |
|
56 |
# precision data
|
57 |
|
|
|
183 |
max_sequence_length=seq,
|
184 |
generator=torch.Generator(device).manual_seed(int(str(random.random()).split(".")[1]))
|
185 |
).images[0]
|
186 |
+
additional_image = True
|
187 |
|
188 |
if title != "":
|
189 |
draw = ImageDraw.Draw(img)
|
|
|
193 |
x = (width - textwidth) // 2
|
194 |
y = (height - textheight) // 2
|
195 |
draw.text((x, y), title,font=font)
|
196 |
+
|
197 |
+
additional_image = img if additional_image else None
|
198 |
|
199 |
if time == 0.0:
|
200 |
return img
|
|
|
212 |
|
213 |
def handle_generate(*_inp):
|
214 |
|
215 |
+
additional_image = None
|
216 |
+
|
217 |
inp = list(_inp)
|
218 |
|
219 |
inp[1] = translate(inp[1],"english")
|
|
|
247 |
if inp[3] == 0.0:
|
248 |
return name, None
|
249 |
else:
|
250 |
+
return additional_image, name
|
251 |
|
252 |
def ui():
|
253 |
global result
|