Spaces:
Runtime error
Runtime error
Commit
·
226f6b7
1
Parent(s):
09bc5a3
Update app.py
Browse files
app.py
CHANGED
@@ -1,25 +1,46 @@
|
|
1 |
-
|
2 |
-
import
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import gradio.components as comp
|
3 |
+
import os
|
4 |
+
|
5 |
+
api_key = os.environ.get("HUGGINGFACE_API_KEY")
|
6 |
+
|
7 |
+
#model_list = [
|
8 |
+
# "stabilityai/stable-diffusion-xl-base-0.9",
|
9 |
+
# "stabilityai/stable-diffusion-2-1",
|
10 |
+
# "stabilityai/stable-diffusion-xl-refiner-0.9",
|
11 |
+
# "stabilityai/stable-diffusion-2-1-base",
|
12 |
+
# "stabilityai/stable-diffusion-2",
|
13 |
+
# "stabilityai/stable-diffusion-2-inpainting",
|
14 |
+
# "stabilityai/stable-diffusion-x4-upscaler",
|
15 |
+
# "stabilityai/stable-diffusion-2-depth",
|
16 |
+
# "stabilityai/stable-diffusion-2-base",
|
17 |
+
# "stabilityai/stable-diffusion-2-1-unclip",
|
18 |
+
# "helenai/stabilityai-stable-diffusion-2-1-base-ov",
|
19 |
+
# "helenai/stabilityai-stable-diffusion-2-1-ov",
|
20 |
+
# "stabilityai/stable-diffusion-2-1-unclip-small"
|
21 |
+
#]
|
22 |
+
|
23 |
+
#default_model = "stabilityai/stable-diffusion-2"
|
24 |
+
#model_name = gr.inputs.Dropdown(choices=model_list, label="Select Model", default=default_model)
|
25 |
+
|
26 |
+
#def generate_image(text, default_model):
|
27 |
+
# model = gr.load(default_model, source="huggingface", api_key=api_key)
|
28 |
+
# return model.predict(text)
|
29 |
+
|
30 |
+
#input_text = gr.inputs.Textbox(label="Input Text")
|
31 |
+
#output_image = comp.Image(label="Generated Image")
|
32 |
+
|
33 |
+
#iface = gr.Interface(
|
34 |
+
# fn=generate_image,
|
35 |
+
# inputs=[input_text, default_model],
|
36 |
+
# outputs=output_image,
|
37 |
+
# title="Text to Image Generation",
|
38 |
+
# description="Generate an image from input text using a Hugging Face model."
|
39 |
+
#)
|
40 |
+
|
41 |
+
#iface.launch()
|
42 |
+
|
43 |
+
title = ".mujo T ai art po O"
|
44 |
+
gr.Interface.load("models/stabilityai/stable-diffusion-2-1", title=title).launch()
|
45 |
+
|
46 |
+
#gr.load("models/stabilityai/stable-diffusion-2-1-base").launch(auth=("admin", "pass"))
|