import gradio as gr def greet(name): return "Hello " + name + "!!" def produce_art(prompt): from diffusers import StableDiffusionPipeline import torch model_id = "atsyplikhin/rita_sd_model" pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16) #.to("cuda") bs = 1 images = pipe([prompt]*bs, num_inference_steps=50, guidance_scale=7.5) # [images.images[i].save(f"rita-stalin-kefir{i+j*bs}.png") for i in range(bs)] return images.images[0] prompt = "RitaT style collage of Stalin with Kefir in outer space, fine details trending on arthouse" iface = gr.Interface(fn=produce_art, inputs="text", outputs="image") iface.launch()