Spaces:
Runtime error
Runtime error
File size: 1,052 Bytes
ad3b5a3 f86cf4a ad3b5a3 f86cf4a 34f5fc4 f86cf4a 34f5fc4 63b7b9a f86cf4a 63b7b9a f86cf4a 449842d f86cf4a b4a2f52 f86cf4a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
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()
|