hkhdair's picture
Create new file
b4c9042
raw
history blame contribute delete
386 Bytes
import gradio as gr
from diffusers import DiffusionPipeline
ldm = DiffusionPipeline.from_pretrained("CompVis/ldm-text2im-large-256")
def inference(prompt):
images = ldm([prompt],
num_inference_steps=10,
eta=0.3,
guidance_scale=6)["sample"]
return images
gr.Interface(inference, "text", gr.Gallery()).launch()