Spaces:
Runtime error
Runtime error
BilalSardar
commited on
Commit
·
17bb8a5
1
Parent(s):
f0464f6
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from diffusers import StableDiffusionPipeline
|
2 |
+
import torch
|
3 |
+
|
4 |
+
modelieo=['nitrosocke/Arcane-Diffusion',
|
5 |
+
'dreamlike-art/dreamlike-diffusion-1.0',
|
6 |
+
'nitrosocke/archer-diffusion',
|
7 |
+
'Linaqruf/anything-v3.0',
|
8 |
+
'nitrosocke/mo-di-diffusion',
|
9 |
+
'nitrosocke/classic-anim-diffusion',
|
10 |
+
'dallinmackay/Van-Gogh-diffusion',
|
11 |
+
'wavymulder/wavyfusion',
|
12 |
+
'wavymulder/Analog-Diffusion',
|
13 |
+
'nitrosocke/redshift-diffusion',
|
14 |
+
'prompthero/midjourney-v4-diffusion',
|
15 |
+
'hakurei/waifu-diffusion',
|
16 |
+
'DGSpitzer/Cyberpunk-Anime-Diffusion',
|
17 |
+
'nitrosocke/elden-ring-diffusion',
|
18 |
+
'naclbit/trinart_stable_diffusion_v2',
|
19 |
+
'nitrosocke/spider-verse-diffusion',
|
20 |
+
'Fictiverse/Stable_Diffusion_BalloonArt_Model',
|
21 |
+
'dallinmackay/Tron-Legacy-diffusion',
|
22 |
+
'lambdalabs/sd-pokemon-diffusers',
|
23 |
+
'AstraliteHeart/pony-diffusion',
|
24 |
+
'nousr/robo-diffusion']
|
25 |
+
|
26 |
+
|
27 |
+
def TextToImage(Prompt,model):
|
28 |
+
model_id = model
|
29 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
30 |
+
pipe = pipe.to("cpu")
|
31 |
+
|
32 |
+
prompt = Prompt
|
33 |
+
image = pipe(prompt).images[0]
|
34 |
+
|
35 |
+
return image
|
36 |
+
|
37 |
+
|
38 |
+
import gradio as gr
|
39 |
+
interface = gr.Interface(fn=TextToImage,
|
40 |
+
inputs=["text", gr.Dropdown(modelieo)],
|
41 |
+
outputs="image",
|
42 |
+
title='Object Detection in Video')
|
43 |
+
|
44 |
+
interface.launch()
|