Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,8 @@ import os
|
|
3 |
import gradio as gr
|
4 |
from transformers import pipeline
|
5 |
|
6 |
-
from diffusers import StableDiffusionPipeline
|
7 |
-
import torch
|
8 |
|
9 |
|
10 |
sd_description = "ζεηζεΎη"
|
@@ -17,19 +17,19 @@ examples = [[os.path.join(os.path.dirname(__file__), "lion.jpg")], [os.path.join
|
|
17 |
app = gr.Interface.from_pipeline(pipe, examples=examples, title='εΎηθ―ε«')
|
18 |
|
19 |
|
20 |
-
model_id = "dreamlike-art/dreamlike-photoreal-2.0"
|
21 |
-
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float32)
|
22 |
-
pipe_v1 = pipe.to("cpu")
|
23 |
|
24 |
|
25 |
-
def generate_image_v1(prompt):
|
26 |
-
|
27 |
|
28 |
-
examples = [["θ½ζ₯"], ["ζ²ζ»©"]]
|
29 |
-
app_v1 = gr.Interface(fn=generate_image_v1, inputs="text", outputs="image", examples=examples)
|
30 |
|
31 |
|
32 |
-
demo = gr.TabbedInterface([sd_demo, app
|
33 |
|
34 |
|
35 |
demo.launch()
|
|
|
3 |
import gradio as gr
|
4 |
from transformers import pipeline
|
5 |
|
6 |
+
# from diffusers import StableDiffusionPipeline
|
7 |
+
# import torch
|
8 |
|
9 |
|
10 |
sd_description = "ζεηζεΎη"
|
|
|
17 |
app = gr.Interface.from_pipeline(pipe, examples=examples, title='εΎηθ―ε«')
|
18 |
|
19 |
|
20 |
+
# model_id = "dreamlike-art/dreamlike-photoreal-2.0"
|
21 |
+
# pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float32)
|
22 |
+
# pipe_v1 = pipe.to("cpu")
|
23 |
|
24 |
|
25 |
+
# def generate_image_v1(prompt):
|
26 |
+
# return pipe_v1(prompt).images[0]
|
27 |
|
28 |
+
# examples = [["θ½ζ₯"], ["ζ²ζ»©"]]
|
29 |
+
# app_v1 = gr.Interface(fn=generate_image_v1, inputs="text", outputs="image", examples=examples)
|
30 |
|
31 |
|
32 |
+
demo = gr.TabbedInterface([sd_demo, app], ["ζεηζεΎη", "εΎηθ―ε«"])
|
33 |
|
34 |
|
35 |
demo.launch()
|