Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import torch
|
3 |
+
from diffusers import DiffusionPipeline
|
4 |
+
# from diffusers import StableDiffusionPipeline
|
5 |
+
|
6 |
+
def generate(prompt):
|
7 |
+
# pipeline = DiffusionPipeline.from_pretrained("jayparmr/CyberRealistic", torch_dtype=torch.float16)
|
8 |
+
pipeline = DiffusionPipeline.from_pretrained("jayparmr/rcnz", use_auth_token="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", torch_dtype=torch.float16)
|
9 |
+
pipeline.to("cuda")
|
10 |
+
return pipeline(prompt).images[0]
|
11 |
+
|
12 |
+
iface = gr.Interface(fn=generate, inputs="text", outputs="image")
|
13 |
+
iface.launch()
|