Spaces:
Sleeping
Sleeping
| 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') | |
| 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() | |