Spaces:
Running
on
Zero
Running
on
Zero
aifeifei798
commited on
Commit
•
983c55a
1
Parent(s):
6a587db
Update app.py
Browse files
app.py
CHANGED
@@ -49,18 +49,31 @@ css="""
|
|
49 |
def infer(prompt, seed=42, randomize_seed=False, width=896, height=1152, num_inference_steps=16, progress=gr.Progress(track_tqdm=True), guidancescale=3.5):
|
50 |
if randomize_seed:
|
51 |
seed = random.randint(0, MAX_SEED)
|
|
|
52 |
generator = torch.Generator().manual_seed(seed)
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
output_type="pil",
|
61 |
-
|
62 |
-
|
63 |
-
|
|
|
64 |
|
65 |
def encode_image(image_path):
|
66 |
"""Encode the image to base64."""
|
|
|
49 |
def infer(prompt, seed=42, randomize_seed=False, width=896, height=1152, num_inference_steps=16, progress=gr.Progress(track_tqdm=True), guidancescale=3.5):
|
50 |
if randomize_seed:
|
51 |
seed = random.randint(0, MAX_SEED)
|
52 |
+
|
53 |
generator = torch.Generator().manual_seed(seed)
|
54 |
+
|
55 |
+
#image = pipe(
|
56 |
+
# prompt = prompt,
|
57 |
+
# width = width,
|
58 |
+
# height = height,
|
59 |
+
# num_inference_steps = num_inference_steps,
|
60 |
+
# generator = generator,
|
61 |
+
# guidance_scale=guidancescale,
|
62 |
+
# output_type="pil",
|
63 |
+
#).images[0]
|
64 |
+
#return image, seed
|
65 |
+
for img in pipe.flux_pipe_call_that_returns_an_iterable_of_images(
|
66 |
+
prompt=prompt,
|
67 |
+
guidance_scale=guidance_scale,
|
68 |
+
num_inference_steps=num_inference_steps,
|
69 |
+
width=width,
|
70 |
+
height=height,
|
71 |
+
generator=generator,
|
72 |
output_type="pil",
|
73 |
+
good_vae=good_vae,
|
74 |
+
):
|
75 |
+
yield img, seed
|
76 |
+
|
77 |
|
78 |
def encode_image(image_path):
|
79 |
"""Encode the image to base64."""
|