Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -50,6 +50,10 @@ def infer(
|
|
50 |
if randomize_seed:
|
51 |
seed = random.randint(0, MAX_SEED)
|
52 |
|
|
|
|
|
|
|
|
|
53 |
generator = torch.Generator().manual_seed(seed)
|
54 |
|
55 |
image = pipe(
|
@@ -129,7 +133,7 @@ with gr.Blocks(css=css) as demo:
|
|
129 |
label="Width",
|
130 |
minimum=256,
|
131 |
maximum=MAX_IMAGE_SIZE,
|
132 |
-
step=
|
133 |
value=512,
|
134 |
)
|
135 |
|
@@ -137,7 +141,7 @@ with gr.Blocks(css=css) as demo:
|
|
137 |
label="Height",
|
138 |
minimum=256,
|
139 |
maximum=MAX_IMAGE_SIZE,
|
140 |
-
step=
|
141 |
value=512,
|
142 |
)
|
143 |
|
@@ -163,4 +167,4 @@ with gr.Blocks(css=css) as demo:
|
|
163 |
)
|
164 |
|
165 |
if __name__ == "__main__":
|
166 |
-
demo.launch()
|
|
|
50 |
if randomize_seed:
|
51 |
seed = random.randint(0, MAX_SEED)
|
52 |
|
53 |
+
# Ensure width and height are divisible by 8
|
54 |
+
width = max(256, (width // 8) * 8)
|
55 |
+
height = max(256, (height // 8) * 8)
|
56 |
+
|
57 |
generator = torch.Generator().manual_seed(seed)
|
58 |
|
59 |
image = pipe(
|
|
|
133 |
label="Width",
|
134 |
minimum=256,
|
135 |
maximum=MAX_IMAGE_SIZE,
|
136 |
+
step=8,
|
137 |
value=512,
|
138 |
)
|
139 |
|
|
|
141 |
label="Height",
|
142 |
minimum=256,
|
143 |
maximum=MAX_IMAGE_SIZE,
|
144 |
+
step=8,
|
145 |
value=512,
|
146 |
)
|
147 |
|
|
|
167 |
)
|
168 |
|
169 |
if __name__ == "__main__":
|
170 |
+
demo.launch()
|