Update app.py
Browse files
app.py
CHANGED
|
@@ -46,7 +46,6 @@ DEFAULT_INFERENCE_STEPS = 6
|
|
| 46 |
IMAGE_WIDTH = 512
|
| 47 |
IMAGE_HEIGHT = 812
|
| 48 |
GUIDANCE_SCALE = 5.5
|
| 49 |
-
image = pipe(prompt, width=width, height=height)
|
| 50 |
|
| 51 |
def resize_to_divisible_by_8(image):
|
| 52 |
width, height = image.size
|
|
@@ -54,6 +53,7 @@ def resize_to_divisible_by_8(image):
|
|
| 54 |
new_height = height + (8 - height % 8) if height % 8 != 0 else height
|
| 55 |
return image.resize((new_width, new_height))
|
| 56 |
|
|
|
|
| 57 |
image = resize_to_divisible_by_8(image)
|
| 58 |
|
| 59 |
# Função simples para gerar imagem
|
|
|
|
| 46 |
IMAGE_WIDTH = 512
|
| 47 |
IMAGE_HEIGHT = 812
|
| 48 |
GUIDANCE_SCALE = 5.5
|
|
|
|
| 49 |
|
| 50 |
def resize_to_divisible_by_8(image):
|
| 51 |
width, height = image.size
|
|
|
|
| 53 |
new_height = height + (8 - height % 8) if height % 8 != 0 else height
|
| 54 |
return image.resize((new_width, new_height))
|
| 55 |
|
| 56 |
+
image = pipe(prompt, width=width, height=height)
|
| 57 |
image = resize_to_divisible_by_8(image)
|
| 58 |
|
| 59 |
# Função simples para gerar imagem
|