Dao3's picture
Duplicate from BilalSardar/Text-To-image-AllModels
d61a077
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='Text to Image')
interface.launch()