Mukh-Oboyob / app.py
ahmedfaiyaz's picture
Update app.py
109d584 verified
raw
history blame
997 Bytes
import gradio as gr
import torch
from diffusers import DiffusionPipeline
from transformers import AutoTokenizer,AutoModel
from diffusers.models import AutoencoderKL
pipeline = DiffusionPipeline.from_pretrained(
"CompVis/stable-diffusion-v1-4",
text_encoder = AutoModel.from_pretrained("csebuetnlp/banglabert"),
custom_pipeline="gr33nr1ng3r/Mukh-Oboyob",
)
pipeline.unet.load_attn_procs("gr33nr1ng3r/Mukh-Oboyob")
def diffusion(text,num_inference_steps,guidance_scale):
prompt=text
image = pipeline(prompt, num_inference_steps=num_inference_steps, guidance_scale=guidance_scale,height=128,width=128).images[0]
return image
mukh_biboron_app = gr.Interface(
diffusion,
[
gr.Textbox(
label="prompt text",
lines=3,
),
gr.Slider(1, 100, value=50),
gr.Slider(1.0, 30.0, value=7.5),
],
"image",
)
if __name__ == "__main__":
mukh_biboron_app.queue(max_size=20).launch(show_error=True)