import gradio as gr import os import sys from pathlib import Path import time models =[ "", "CompVis/stable-diffusion-v1-4", "runwayml/stable-diffusion-v1-5", "prompthero/openjourney", "stabilityai/stable-diffusion-2-1", "stabilityai/stable-diffusion-2-1-base", "SG161222/Realistic_Vision_V1.4", "Linaqruf/anything-v3.0", "eimiss/EimisAnimeDiffusion_1.0v", "nitrosocke/Nitro-Diffusion", "wavymulder/portraitplus", "22h/vintedois-diffusion-v0-1", "dreamlike-art/dreamlike-photoreal-2.0", "dreamlike-art/dreamlike-diffusion-1.0", "wavymulder/Analog-Diffusion", "nitrosocke/redshift-diffusion", "claudfuen/photorealistic-fuen-v1", "prompthero/openjourney-v2", "johnslegers/epic-diffusion", "nitrosocke/Arcane-Diffusion", "darkstorm2150/Protogen_x5.8_Official_Release", ] current_model = models[5] models2=[ gr.Interface.load(f"models/{models[1]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[2]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[3]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[4]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[5]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[6]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[7]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[8]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[9]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[10]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[11]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[12]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[13]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[14]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[15]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[16]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[17]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[18]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[19]}",live=True,preprocess=True), gr.Interface.load(f"models/{models[20]}",live=True,preprocess=True), ] text_gen=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion_link",live=True, preprocess=True) def send_it1(inputs,model_choice=5, count = 1): if model_choice==None: model_choice=5 t=0 output_list=[] while t""") gr.HTML("""Top 20 Diffuion""") with gr.Column(): gr.Markdown("""

Top 20 Diffusion

""") with gr.Accordion("Details",open=False): with gr.Tab("Description"): gr.Markdown("""
Enter your Prompt into the "Short Prompt" box and click "Magic Prompt" to load a prettified version of your prompt
When you are satisfied with the prompt that is in the "Text to Image" box, click "Launch" to load the Models.

Images load faster with a simpler prompt.

Images will cancel loading after 1 minute to preserve the quality of the queue.
Simply Click "Launch" again to try loading the incomplete images.
Page refreshes every 3 minutes for this Demo.

Not responsible for content, use at your own risk.
""") with gr.Tab("DIY"): gr.HTML("""
Easy Clone:

Copy/Paste this code in your new app.py file

import gradio as gr
max_d=gr.Interface.load("spaces/Omnibus/Top-20-Diffusion")
max_d.launch()
""") with gr.Tab("Credits"): with gr.Row(): with gr.Column(style="text-align:left;"): gr.HTML("""

Magic Prompt:

Magic Prompt Stable Diffusion

Magic Diffusion

""") with gr.Column(style="text-align:left;"): gr.HTML(f"""

Models by:
{models[1]}
{models[2]}
{models[3]}
{models[4]}
{models[5]}
{models[6]}
{models[7]}
{models[8]}
{models[9]}
{models[10]}
{models[11]}
{models[12]}
{models[13]}
{models[14]}
{models[15]}
{models[16]}
{models[17]}
{models[18]}
{models[19]}
{models[20]}

""") with gr.Row(): with gr.Column(): input_text=gr.Textbox(label="Short Prompt") prompt=gr.Textbox(label="Text to Image Prompt",visible=True) model_name1 = gr.Dropdown(show_label=False, choices=[m for m in models], type="index", value=current_model, interactive=True) count = gr.Number(value=1) with gr.Column(): see_prompts=gr.Button("Magic Prompt") with gr.Row(): run=gr.Button("Launch") clear_btn=gr.Button("Clear") with gr.Column(visible=True) as timo: with gr.Row(): output1=gr.Gallery(columns=2) def get_prompts(prompt_text): gen=text_gen(prompt_text) return gen run1=run.click(send_it1, inputs=[prompt, model_name1,count], outputs=[output1]) myface.queue(concurrency_count=400,status_update_rate=1) myface.launch(inline=True,show_api=True)