import gradio as gr import os import sys from pathlib import Path import time import accelerate models = [ "", "runwayml/stable-diffusion-v1-5", "CompVis/stable-diffusion-v1-4", "claudfuen/photorealistic-fuen-v1", "andite/anything-v4.0", "naclbit/trinart_stable_diffusion_v2", "nitrosocke/Arcane-Diffusion", "nitrosocke/archer-diffusion", "nitrosocke/elden-ring-diffusion", "nitrosocke/redshift-diffusion", "nitrosocke/spider-verse-diffusion", "nitrosocke/mo-di-diffusion", "nitrosocke/classic-anim-diffusion", "dreamlike-art/dreamlike-photoreal-1.0", "dreamlike-art/dreamlike-photoreal-2.0", "wavymulder/wavyfusion", "wavymulder/Analog-Diffusion", "prompthero/midjourney-v4-diffusion", "prompthero/openjourney", "dallinmackay/Van-Gogh-diffusion", "hakurei/waifu-diffusion", "DGSpitzer/Cyberpunk-Anime-Diffusion", "Fictiverse/Stable_Diffusion_BalloonArt_Model", "dallinmackay/Tron-Legacy-diffusion", "AstraliteHeart/pony-diffusion", "nousr/robo-diffusion", "Linaqruf/anything-v3", "Omnibus/maximum_diffusion_fast", "", ] model_1=models[1] model_2=models[2] model_3=models[3] model_4=models[4] model_5=models[5] model_6=models[6] model_7=models[9] model_8=models[13] model_9=models[14] model_10=models[15] model_11=models[16] model_12=models[17] text_gen=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link",live=True, preprocess=True) proc1=gr.Interface.load(f"models/{model_1}",live=False,preprocess=True, postprocess=False) proc2=gr.Interface.load(f"models/{model_2}",live=False,preprocess=True, postprocess=False) proc3=gr.Interface.load(f"models/{model_3}",live=False,preprocess=True, postprocess=False) proc4=gr.Interface.load(f"models/{model_4}",live=False,preprocess=True, postprocess=False) proc5=gr.Interface.load(f"models/{model_5}",live=False,preprocess=True, postprocess=False) proc6=gr.Interface.load(f"models/{model_6}",live=False,preprocess=True, postprocess=False) proc7=gr.Interface.load(f"models/{model_7}",live=False,preprocess=True, postprocess=False) proc8=gr.Interface.load(f"models/{model_8}",live=False,preprocess=True, postprocess=False) proc9=gr.Interface.load(f"models/{model_9}",live=False,preprocess=True, postprocess=False) proc10=gr.Interface.load(f"models/{model_10}",live=False,preprocess=True, postprocess=False) proc11=gr.Interface.load(f"models/{model_11}",live=False,preprocess=True, postprocess=False) proc12=gr.Interface.load(f"models/{model_12}",live=False,preprocess=True, postprocess=False) ''' proc1=gr.Interface.load("models/nitrosocke/Arcane-Diffusion", live=False, preprocess=True, postprocess=False) proc2=gr.Interface.load("models/naclbit/trinart_stable_diffusion_v2", live=False, preprocess=True, postprocess=False) proc3=gr.Interface.load("models/nitrosocke/redshift-diffusion", live=False, preprocess=True, postprocess=False) proc4=gr.Interface.load("models/runwayml/stable-diffusion-v1-5", live=False, preprocess=True, postprocess=False) proc5=gr.Interface.load("models/claudfuen/photorealistic-fuen-v1", live=False, preprocess=True, postprocess=False) proc6=gr.Interface.load("models/CompVis/stable-diffusion-v1-4", live=False, preprocess=True, postprocess=False) proc7=gr.Interface.load("models/Linaqruf/anything-v3.0", live=False, preprocess=True, postprocess=False) proc8=gr.Interface.load("models/andite/anything-v4.0", live=False, preprocess=True, postprocess=False) proc9=gr.Interface.load("models/dreamlike-art/dreamlike-photoreal-1.0", live=False, preprocess=True, postprocess=False) proc10=gr.Interface.load("models/prompthero/openjourney", live=False, preprocess=True, postprocess=False) proc11=gr.Interface.load("models/prompthero/midjourney-v4-diffusion", live=False, preprocess=True, postprocess=False) proc12=gr.Interface.load("models/wavymulder/Analog-Diffusion", live=False, preprocess=True, postprocess=False) ''' def get_prompts(prompt_text): return text_gen(prompt_text) def send_it1(inputs,proc1=proc1): output1=proc1(inputs) return(output1) def send_it2(inputs,proc2=proc2): output2=proc2(inputs) return(output2) def send_it3(inputs,proc3=proc3): output3=proc3(inputs) return(output3) def send_it4(inputs,proc4=proc4): output4=proc4(inputs) return(output4) def send_it5(inputs,proc5=proc5): output5=proc5(inputs) return(output5) def send_it6(inputs,proc6=proc6): output6=proc6(inputs) return(output6) def send_it7(inputs,proc7=proc7): output7=proc7(inputs) return(output7) def send_it8(inputs,proc8=proc8): output8=proc8(inputs) return(output8) def send_it9(inputs,proc9=proc9): output9=proc9(inputs) return(output9) def send_it10(inputs,proc10=proc10): output10=proc10(inputs) return(output10) def send_it11(inputs,proc11=proc11): output11=proc11(inputs) return(output11) def send_it12(inputs,proc12=proc12): output12=proc12(inputs) return(output12) def main(): with gr.Blocks(batch=False) as myface: with gr.Row(): with gr.Tab("Title"): gr.HTML("""
Text to Image Model Comparison Space - CPU
This space becomes quickly encumbered when even 1 model of 12 fails to load, or error out
Any tips on how to "time-out" Gradio.Interface models are welcome in the "Community" button above
I learned everything I know from:
Models by @Gustavosta, @haruu1367, @Helixngc7293, @dal_mack, @prompthero and others.