Spaces:
Sleeping
Sleeping
File size: 587 Bytes
79e7302 8cc52a0 7d266d7 79e7302 4e850b1 79e7302 097a7ab |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import gradio as gr
import spaces
import torch
import os
from diffusers import AutoPipelineForText2Image,DEISMultistepScheduler
pipe = AutoPipelineForText2Image.from_pretrained('Lykon/AAM_XL_AnimeMix', torch_dtype=torch.float16, variant="fp16")
pipe.scheduler = DEISMultistepScheduler.from_config(pipe.scheduler.config)
pipe = pipe.to("cuda")
@spaces.GPU
def predict(prompt):
return pipe(prompt, num_inference_steps=25).images[0]
demo = gr.Interface(
fn=predict,
inputs='text',
outputs= 'image',
)
demo.launch()
# demo.launch(auth=(os.getenv('USER'), os.getenv('PASSWORD')))
|