game-test / diff.py
Omnibus's picture
Update diff.py
0958d7b verified
import gradio as gr
class SendIt:
def __init__(self):
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",
"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",
]
self.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),
]
do_it=SendIt()
def send_it(inputs,model_choice=5, count = 1):
t=0
output_list=[]
while t<int(count):
proc1=do_it.models2[int(model_choice)]
output1=proc1(inputs)
output_list.append(output1)
inputs=f"{inputs} "
t+=1
return(output_list)