philipp-zettl's picture
Update app.py
6bc9074 verified
raw
history blame
341 Bytes
import gradio as gr
import spaces
from diffusers import DiffusionPipeline
model_name = 'UnfilteredAI/NSFW-gen-v2'
pipe = DiffusionPipeline.from_pretrained(model_name)
pipe.to('cuda')
@spaces.GPU
def generate(prompt):
return pipe(prompt).images
gr.Interface(
fn=generate,
inputs=gr.Text(),
outputs=gr.Gallery(),
).launch()