zw89 commited on
Commit
54e4ef3
·
verified ·
1 Parent(s): 0dce3b4

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from diffusers import StableDiffusionPipeline
3
+ import torch
4
+
5
+ # Загружаем модель Deliberate
6
+ model_id = "XpucT/deliberate-v3-archive"
7
+ pipe = StableDiffusionPipeline.from_pretrained(model_id)
8
+
9
+ def generate(prompt):
10
+ # Генерируем картинку (20 шагов)
11
+ image = pipe(prompt, num_inference_steps=20).images[0]
12
+ return image
13
+
14
+ # Создаем интерфейс
15
+ demo = gr.Interface(fn=generate, inputs="text", outputs="image", title="Deliberate V3 Artist")
16
+ demo.launch()