Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,8 +2,9 @@ from diffusers import DiffusionPipeline
|
|
| 2 |
import matplotlib.pyplot as plt
|
| 3 |
import torch
|
| 4 |
import gradio as gr
|
|
|
|
| 5 |
pipeline = DiffusionPipeline.from_pretrained("anusha-bhambore/live-eventful")
|
| 6 |
-
pipeline = pipeline.to(
|
| 7 |
def generate_image_interface(prompt, negative_prompt,num_inference_steps=50, weight=640):
|
| 8 |
params = {'prompt': prompt, 'num_inference_steps': num_inference_steps, 'num_images_per_prompt':2, 'height':int(1.2*weight),
|
| 9 |
'weight': weight, 'negative_prompt': negative_prompt}
|
|
|
|
| 2 |
import matplotlib.pyplot as plt
|
| 3 |
import torch
|
| 4 |
import gradio as gr
|
| 5 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 6 |
pipeline = DiffusionPipeline.from_pretrained("anusha-bhambore/live-eventful")
|
| 7 |
+
pipeline = pipeline.to(device)
|
| 8 |
def generate_image_interface(prompt, negative_prompt,num_inference_steps=50, weight=640):
|
| 9 |
params = {'prompt': prompt, 'num_inference_steps': num_inference_steps, 'num_images_per_prompt':2, 'height':int(1.2*weight),
|
| 10 |
'weight': weight, 'negative_prompt': negative_prompt}
|