Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,18 +25,27 @@ def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, guidan
|
|
| 25 |
if randomize_seed:
|
| 26 |
seed = random.randint(0, MAX_SEED)
|
| 27 |
generator = torch.Generator().manual_seed(seed)
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
examples = [
|
| 42 |
"a tiny astronaut hatching from an egg on the moon",
|
|
|
|
| 25 |
if randomize_seed:
|
| 26 |
seed = random.randint(0, MAX_SEED)
|
| 27 |
generator = torch.Generator().manual_seed(seed)
|
| 28 |
+
image = pipe(
|
| 29 |
+
prompt,
|
| 30 |
+
height=1024,
|
| 31 |
+
width=1024,
|
| 32 |
+
guidance_scale=3.5,
|
| 33 |
+
num_inference_steps=50,
|
| 34 |
+
max_sequence_length=512,
|
| 35 |
+
generator=torch.Generator("cpu").manual_seed(0)
|
| 36 |
+
).images[0]
|
| 37 |
+
return image
|
| 38 |
+
# for img in pipe.flux_pipe_call_that_returns_an_iterable_of_images(
|
| 39 |
+
# prompt=prompt,
|
| 40 |
+
# guidance_scale=guidance_scale,
|
| 41 |
+
# num_inference_steps=num_inference_steps,
|
| 42 |
+
# width=width,
|
| 43 |
+
# height=height,
|
| 44 |
+
# generator=generator,
|
| 45 |
+
# output_type="pil",
|
| 46 |
+
# good_vae=good_vae,
|
| 47 |
+
# ):
|
| 48 |
+
# yield img, seed
|
| 49 |
|
| 50 |
examples = [
|
| 51 |
"a tiny astronaut hatching from an egg on the moon",
|