pseudo-flex-v2 / app.py
PseudoTerminal X
Update app.py
68dc9bc verified
raw
history blame
565 Bytes
import spaces, torch
from diffusers import DiffusionPipeline
import gradio as gr
pipe = DiffusionPipeline.from_pretrained('ptx0/terminus-xl-velocity-v2', torch_dtype=torch.bfloat16)
#pipe.unet = torch.compile(pipe.unet)
pipe.to('cuda')
@spaces.GPU
def generate(prompt):
return pipe(
prompt,
negative_prompt="underexposed, blurry, ugly, washed-out",
guidance_rescale=0.7,
guidance_scale=9.5,
num_inference_steps=30,
).images
gr.Interface(
fn=generate,
inputs=gr.Text(),
outputs=gr.Gallery(),
).launch()