Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,9 +21,13 @@ pipe = GlmImagePipeline.from_pretrained(
|
|
| 21 |
|
| 22 |
|
| 23 |
@spaces.GPU(duration=120)
|
| 24 |
-
def infer(prompt,
|
| 25 |
-
num_inference_steps=50, guidance_scale=1.5, progress=gr.Progress(track_tqdm=True)):
|
| 26 |
"""Main inference function"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
print("Randomizing seed")
|
| 28 |
if randomize_seed:
|
| 29 |
seed = random.randint(0, MAX_SEED)
|
|
@@ -199,7 +203,7 @@ GLM-Image is a hybrid auto-regressive + diffusion 9B parameters model by z.ai
|
|
| 199 |
gr.on(
|
| 200 |
triggers=[run_button.click, prompt.submit],
|
| 201 |
fn=infer,
|
| 202 |
-
inputs=[prompt,
|
| 203 |
outputs=[result, seed]
|
| 204 |
)
|
| 205 |
|
|
|
|
| 21 |
|
| 22 |
|
| 23 |
@spaces.GPU(duration=120)
|
| 24 |
+
def infer(prompt, seed=42, guidance_scale=1.5):
|
|
|
|
| 25 |
"""Main inference function"""
|
| 26 |
+
randomize_seed=False
|
| 27 |
+
width=1024
|
| 28 |
+
height=1024
|
| 29 |
+
input_images=None
|
| 30 |
+
num_inference_steps=50
|
| 31 |
print("Randomizing seed")
|
| 32 |
if randomize_seed:
|
| 33 |
seed = random.randint(0, MAX_SEED)
|
|
|
|
| 203 |
gr.on(
|
| 204 |
triggers=[run_button.click, prompt.submit],
|
| 205 |
fn=infer,
|
| 206 |
+
inputs=[prompt, seed, guidance_scale],
|
| 207 |
outputs=[result, seed]
|
| 208 |
)
|
| 209 |
|