Spaces:
Runtime error
Runtime error
Changed to simpler model and code
Browse files
app.py
CHANGED
@@ -1,34 +1,34 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
from diffusers import DiffusionPipeline
|
3 |
|
4 |
-
# get_completion = pipeline("image-to-text",model="nlpconnect/vit-gpt2-image-captioning")
|
5 |
|
6 |
-
# pipeline = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
|
7 |
-
pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
|
8 |
|
9 |
-
# def summarize(input):
|
10 |
-
# output = get_completion(input)
|
11 |
-
# return output[0]['generated_text']
|
12 |
|
13 |
-
# def captioner(image):
|
14 |
-
# result = get_completion(image)
|
15 |
-
# return result[0]['generated_text']
|
16 |
|
17 |
-
def generate(prompt):
|
18 |
-
|
19 |
|
20 |
-
gr.close_all()
|
21 |
-
demo = gr.Interface(fn=generate,
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
|
29 |
-
demo.launch()
|
30 |
|
31 |
|
32 |
-
|
33 |
|
34 |
-
|
|
|
1 |
+
# import gradio as gr
|
2 |
+
# from diffusers import DiffusionPipeline
|
3 |
|
4 |
+
# # get_completion = pipeline("image-to-text",model="nlpconnect/vit-gpt2-image-captioning")
|
5 |
|
6 |
+
# # pipeline = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
|
7 |
+
# pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
|
8 |
|
9 |
+
# # def summarize(input):
|
10 |
+
# # output = get_completion(input)
|
11 |
+
# # return output[0]['generated_text']
|
12 |
|
13 |
+
# # def captioner(image):
|
14 |
+
# # result = get_completion(image)
|
15 |
+
# # return result[0]['generated_text']
|
16 |
|
17 |
+
# def generate(prompt):
|
18 |
+
# return pipeline(prompt).images[0]
|
19 |
|
20 |
+
# gr.close_all()
|
21 |
+
# demo = gr.Interface(fn=generate,
|
22 |
+
# inputs=[gr.Textbox(label="Your prompt")],
|
23 |
+
# outputs=[gr.Image(label="Result")],
|
24 |
+
# title="Image Generation with Stable Diffusion",
|
25 |
+
# description="Generate any image with Stable Diffusion",
|
26 |
+
# allow_flagging="never",
|
27 |
+
# examples=["the spirit of a tamagotchi wandering in the city of Vienna","a mecha robot in a favela"])
|
28 |
|
29 |
+
# demo.launch()
|
30 |
|
31 |
|
32 |
+
import gradio as gr
|
33 |
|
34 |
+
gr.Interface.load("models/runwayml/stable-diffusion-v1-5").launch()
|