Spaces:
Sleeping
Sleeping
Add application file
Browse files
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import spaces
|
3 |
+
import torch
|
4 |
+
from diffusers import StableDiffusionXLPipeline,DiffusionPipeline,AutoPipelineForText2Image, DEISMultistepScheduler
|
5 |
+
|
6 |
+
pipe = AutoPipelineForText2Image.from_pretrained('Lykon/AAM_XL_AnimeMix', torch_dtype=torch.float16, variant="fp16")
|
7 |
+
pipe.scheduler = DEISMultistepScheduler.from_config(pipe.scheduler.config)
|
8 |
+
|
9 |
+
@spaces.GPU
|
10 |
+
def predict(prompt):
|
11 |
+
return pipe(prompt, num_inference_steps=25).images[0]
|
12 |
+
|
13 |
+
demo = gr.Interface(
|
14 |
+
fn=predict,
|
15 |
+
inputs='text',
|
16 |
+
outputs= 'image',
|
17 |
+
)
|
18 |
+
demo.launch()
|