Spaces:
Sleeping
Sleeping
zhiweili
commited on
Commit
·
7d76117
1
Parent(s):
e4f4874
fix:resize
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
import torch
|
3 |
from diffusers import AutoPipelineForImage2Image, DPMSolverMultistepScheduler
|
4 |
|
@@ -14,7 +15,7 @@ generator = torch.Generator(device).manual_seed(0)
|
|
14 |
|
15 |
def image_to_image(input_image, prompt, guidance_scale, num_inference_steps):
|
16 |
# resize image to 512x512
|
17 |
-
input_image =
|
18 |
# Generate the output image
|
19 |
output_image = pipeline(
|
20 |
generator=generator,
|
|
|
1 |
import gradio as gr
|
2 |
+
import cv2
|
3 |
import torch
|
4 |
from diffusers import AutoPipelineForImage2Image, DPMSolverMultistepScheduler
|
5 |
|
|
|
15 |
|
16 |
def image_to_image(input_image, prompt, guidance_scale, num_inference_steps):
|
17 |
# resize image to 512x512
|
18 |
+
input_image = cv2.resize(input_image, (512, 512))
|
19 |
# Generate the output image
|
20 |
output_image = pipeline(
|
21 |
generator=generator,
|