Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -775,21 +775,6 @@ def generate_random_string(length):
|
|
775 |
characters = str(ascii_letters + digits)
|
776 |
return ''.join(random.choice(characters) for _ in range(length))
|
777 |
|
778 |
-
def pipe_generate_image(p1,p2,h,w):
|
779 |
-
for img in pipe.flux_pipe_call_that_returns_an_iterable_of_images(
|
780 |
-
prompt=p1,
|
781 |
-
negative_prompt=p2,
|
782 |
-
height=h,
|
783 |
-
width=w,
|
784 |
-
output_type="pil",
|
785 |
-
guidance_scale=img_accu,
|
786 |
-
num_images_per_prompt=1,
|
787 |
-
num_inference_steps=image_steps,
|
788 |
-
max_sequence_length=seq,
|
789 |
-
generator=torch.Generator(device).manual_seed(random.randint(0, MAX_SEED))
|
790 |
-
):
|
791 |
-
yield img
|
792 |
-
|
793 |
def add_song_cover_text(img,artist,song,h,w):
|
794 |
|
795 |
draw = ImageDraw.Draw(img,mode="RGBA")
|
@@ -1458,7 +1443,19 @@ def handle_generation(h,w,d):
|
|
1458 |
Negative: {neg}
|
1459 |
""")
|
1460 |
|
1461 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1462 |
|
1463 |
# entry
|
1464 |
|
|
|
775 |
characters = str(ascii_letters + digits)
|
776 |
return ''.join(random.choice(characters) for _ in range(length))
|
777 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
778 |
def add_song_cover_text(img,artist,song,h,w):
|
779 |
|
780 |
draw = ImageDraw.Draw(img,mode="RGBA")
|
|
|
1443 |
Negative: {neg}
|
1444 |
""")
|
1445 |
|
1446 |
+
for img in pipe.flux_pipe_call_that_returns_an_iterable_of_images(
|
1447 |
+
prompt=pos,
|
1448 |
+
negative_prompt=neg,
|
1449 |
+
height=h,
|
1450 |
+
width=w,
|
1451 |
+
output_type="pil",
|
1452 |
+
guidance_scale=img_accu,
|
1453 |
+
num_images_per_prompt=1,
|
1454 |
+
num_inference_steps=image_steps,
|
1455 |
+
max_sequence_length=seq,
|
1456 |
+
generator=torch.Generator(device).manual_seed(random.randint(0, MAX_SEED))
|
1457 |
+
):
|
1458 |
+
yield img
|
1459 |
|
1460 |
# entry
|
1461 |
|