Spaces:
Runtime error
Runtime error
| from diffusers import DiffusionPipeline | |
| import matplotlib.pyplot as plt | |
| import torch | |
| import gradio as gr | |
| device = "cuda" if torch.cuda.is_available() else "cpu" | |
| pipeline = DiffusionPipeline.from_pretrained("anusha-bhambore/live-eventful") | |
| pipeline = pipeline.to(device) | |
| def generate_image_interface(prompt, negative_prompt, num_inference_steps=50, weight=640): | |
| params = {'prompt': prompt, 'num_inference_steps': num_inference_steps, 'num_images_per_prompt':2, 'height':int(1.2*weight), | |
| 'weight': weight, 'negative_prompt': negative_prompt} | |
| img = pipeline(**params).images | |
| return img[0],img[1] | |
| description = "Experience the magic of personalized birthday event design with our innovative web app! Simply input your preferences and prompts, and watch as your creative ideas transform into stunning, one-of-a-kind birthday event images. " | |
| demo = gr.Interface(generate_image_interface,title="Birthday Events", inputs=["text","text",gr.Slider(1,100),gr.Slider(512,640)], outputs=["image","image"], description=description) | |
| demo.launch() | |