xfh's picture
init
24d2459
raw
history blame
1.06 kB
from stable_diffusion import Text2img, Args
import gradio as gr
args = Args("", 5, None, 7.5, 512, 512, 443, "cpu", "/tmp/mdjrny-v4.pt")
model = Text2img.instance(args)
def text2img_output(phrase):
return model(phrase)
readme = open("me.md","rb+").read().decode("utf-8")
phrase = gr.components.Textbox(
value="a very beautiful young anime tennis girl, full body, long wavy blond hair, sky blue eyes, full round face, short smile, bikini, miniskirt, highly detailed, cinematic wallpaper by stanley artgerm lau ")
text2img_out = gr.components.Image(type="numpy")
instance = gr.Blocks()
with instance:
with gr.Tabs():
with gr.TabItem("Text2Img"):
gr.Interface(fn=text2img_output, inputs=phrase, outputs=text2img_out, allow_flagging= "manual")
with gr.TabItem("Notes"):
gr.Markdown(
"Text2Img default config -- steps:5, seed:443, device:cpu, weight type:midjourney-v4-diffusion, width:512, height:512."),
gr.Markdown(readme)
instance.queue(concurrency_count=20).launch(share=False)