Spaces:
Running
Running
Commit
·
b358bdd
1
Parent(s):
396eb0c
update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,8 @@ def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance
|
|
28 |
)
|
29 |
return image, seed
|
30 |
|
31 |
-
|
|
|
32 |
fn=infer,
|
33 |
inputs=[
|
34 |
gr.Textbox(label="Prompt"),
|
@@ -48,8 +49,13 @@ demo = gr.Interface(
|
|
48 |
["A futuristic cityscape at sunset", "", 0, True, 768, 768, 0.0, 2],
|
49 |
["A cat in a space suit", "", 0, True, 768, 768, 0.0, 2],
|
50 |
],
|
51 |
-
title="SDXL Turbo Text-to-Image",
|
52 |
allow_flagging="never"
|
53 |
)
|
54 |
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
)
|
29 |
return image, seed
|
30 |
|
31 |
+
# Step 1: Build the interface (as before)
|
32 |
+
interface = gr.Interface(
|
33 |
fn=infer,
|
34 |
inputs=[
|
35 |
gr.Textbox(label="Prompt"),
|
|
|
49 |
["A futuristic cityscape at sunset", "", 0, True, 768, 768, 0.0, 2],
|
50 |
["A cat in a space suit", "", 0, True, 768, 768, 0.0, 2],
|
51 |
],
|
|
|
52 |
allow_flagging="never"
|
53 |
)
|
54 |
|
55 |
+
# Step 2: Render the interface inside a Blocks container
|
56 |
+
with gr.Blocks() as demo:
|
57 |
+
interface.render()
|
58 |
+
|
59 |
+
# Step 3: Launch cleanly
|
60 |
+
if __name__ == "__main__":
|
61 |
+
demo.launch(show_api=False)
|