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