from stable_diffusion import Generate2img, Args import gradio as gr args = Args("", 5, None, 7.5, 512, 512, 443, "cpu", "./mdjrny-v4.pt") model = Generate2img.instance(args) def text2img_output(phrase): return model(phrase) readme = open("me.md","rb+").read().decode("utf-8") phrase = gr.components.Textbox( value="anthropomorphic cat portrait art") 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) # # # 1) anthropomorphic cat portrait art # # ![a](https://huggingface.co/spaces/xfh/min-stable-diffusion-web/resolve/main/rendered.png) # # 2) anthropomorphic cat portrait art(mdjrny-v4.pt) # # ![a](https://huggingface.co/spaces/xfh/min-stable-diffusion-web/resolve/main/rendered2.png) # # 3) Kung Fu Panda(weight: wd-1-3-penultimate-ucg-cont.pt, steps:50) # # ![a](https://huggingface.co/spaces/xfh/min-stable-diffusion-web/resolve/main/rendered3.png) # ![a](https://huggingface.co/spaces/xfh/min-stable-diffusion-web/resolve/main/rendered4.png) #