Spaces:
Running
on
Zero
Running
on
Zero
philipp-zettl
commited on
Commit
•
6bc9074
1
Parent(s):
fe6636d
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,18 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
import spaces
|
3 |
+
from diffusers import DiffusionPipeline
|
4 |
|
5 |
+
|
6 |
+
model_name = 'UnfilteredAI/NSFW-gen-v2'
|
7 |
+
pipe = DiffusionPipeline.from_pretrained(model_name)
|
8 |
+
pipe.to('cuda')
|
9 |
+
|
10 |
+
@spaces.GPU
|
11 |
+
def generate(prompt):
|
12 |
+
return pipe(prompt).images
|
13 |
+
|
14 |
+
gr.Interface(
|
15 |
+
fn=generate,
|
16 |
+
inputs=gr.Text(),
|
17 |
+
outputs=gr.Gallery(),
|
18 |
+
).launch()
|