Spaces:
Running
Running
Commit
•
167679a
1
Parent(s):
74abcb6
Update app.py
Browse files
app.py
CHANGED
@@ -1,25 +1,21 @@
|
|
1 |
import gradio as gr
|
2 |
-
import
|
3 |
-
from diffusers import AutoPipelineForText2Image
|
4 |
|
5 |
-
#
|
6 |
-
|
7 |
-
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
|
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
17 |
|
18 |
-
|
19 |
-
gr.Interface(
|
20 |
-
generate_image,
|
21 |
-
inputs=input_text,
|
22 |
-
outputs=output_image,
|
23 |
-
title="Stable Diffusion SDXL Turbo",
|
24 |
-
description="Enter a prompt and generate an image based on the input prompt"
|
25 |
-
).launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
import replicate
|
|
|
3 |
|
4 |
+
# Set the replicate API token
|
5 |
+
import os
|
6 |
+
os.environ["REPLICATE_API_TOKEN"] = "r8_JSR8xlRoCk6cmq3qEOOThVTn3dAgdPq1bWXdj"
|
7 |
|
8 |
+
def generate_output(prompt):
|
9 |
+
output = replicate.run(
|
10 |
+
"fofr/sdxl-turbo:6244ebc4d96ffcc48fa1270d22a1f014addf79c41732fe205fb1ff638c409267",
|
11 |
+
input={"prompt": prompt}
|
12 |
+
)
|
13 |
+
return output
|
14 |
|
15 |
+
iface = gr.Interface(
|
16 |
+
fn=generate_output,
|
17 |
+
inputs=gr.inputs.Textbox(label="Input Prompt"),
|
18 |
+
outputs=gr.outputs.Textbox(label="Model Output")
|
19 |
+
)
|
20 |
|
21 |
+
iface.launch(share=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|