Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,7 @@ MAX_SEED = np.iinfo(np.int32).max
|
|
| 20 |
MAX_IMAGE_SIZE = 1024
|
| 21 |
|
| 22 |
@spaces.GPU(duration=5)
|
| 23 |
-
def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, guidance_scale=3.5, num_inference_steps=
|
| 24 |
if randomize_seed:
|
| 25 |
seed = random.randint(0, MAX_SEED)
|
| 26 |
generator = torch.Generator().manual_seed(seed)
|
|
@@ -32,10 +32,10 @@ def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, guidan
|
|
| 32 |
width=width,
|
| 33 |
height=height,
|
| 34 |
generator=generator,
|
| 35 |
-
output_type="pil"
|
| 36 |
-
good_vae=good_vae,
|
| 37 |
)
|
| 38 |
-
|
|
|
|
| 39 |
|
| 40 |
examples = [
|
| 41 |
"a tiny astronaut hatching from an egg on the moon",
|
|
|
|
| 20 |
MAX_IMAGE_SIZE = 1024
|
| 21 |
|
| 22 |
@spaces.GPU(duration=5)
|
| 23 |
+
def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, guidance_scale=3.5, num_inference_steps=2, progress=gr.Progress(track_tqdm=True)):
|
| 24 |
if randomize_seed:
|
| 25 |
seed = random.randint(0, MAX_SEED)
|
| 26 |
generator = torch.Generator().manual_seed(seed)
|
|
|
|
| 32 |
width=width,
|
| 33 |
height=height,
|
| 34 |
generator=generator,
|
| 35 |
+
output_type="pil"
|
|
|
|
| 36 |
)
|
| 37 |
+
print(img)
|
| 38 |
+
return img.images[0], seed
|
| 39 |
|
| 40 |
examples = [
|
| 41 |
"a tiny astronaut hatching from an egg on the moon",
|