LEIDIA commited on
Commit
41bff10
·
verified ·
1 Parent(s): 80a8ded

Update app.py

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