File size: 494 Bytes
b6b08f6 3353a40 af2f25b 3353a40 b6b08f6 a2ffcba af2f25b ad1a1ef a2ffcba af2f25b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import gradio as gr
import requests
import os
name = "runwayml/stable-diffusion-v1-5"
model = gr.Interface.load(f"models/{name}")
o = os.getenv("P")
h = "Q"
def ac():
def im_fn(put):
if h == o:
return model(put, negative_prompt="blury")
elif h != o:
return(None)
with gr.Blocks() as b:
put = gr.Textbox()
out = gr.Image()
btn = gr.Button()
btn.click(im_fn,put,out)
b.queue(concurrency_count=100).launch()
ac() |