Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -132,13 +132,15 @@ def tiled_flux_img2img(pipe, prompt, image, strength, steps, guidance, generator
|
|
132 |
if x > 0 or y > 0:
|
133 |
# Simple linear blend on overlaps
|
134 |
mask = Image.new('L', (tile_w, tile_h), 255)
|
|
|
|
|
135 |
if x > 0:
|
136 |
-
for i in range(
|
137 |
for j in range(tile_h):
|
138 |
mask.putpixel((i, j), int(255 * (i / overlap)))
|
139 |
if y > 0:
|
140 |
for i in range(tile_w):
|
141 |
-
for j in range(
|
142 |
mask.putpixel((i, j), int(255 * (j / overlap)))
|
143 |
output.paste(gen_tile, paste_box, mask)
|
144 |
else:
|
@@ -488,5 +490,4 @@ with gr.Blocks(css=css, title="🎨 AI Image Upscaler - FLUX") as demo:
|
|
488 |
""")
|
489 |
|
490 |
if __name__ == "__main__":
|
491 |
-
demo.queue().launch(share=True, server_name="0.0.0.0", server_port=7860)
|
492 |
-
</xai:function_call
|
|
|
132 |
if x > 0 or y > 0:
|
133 |
# Simple linear blend on overlaps
|
134 |
mask = Image.new('L', (tile_w, tile_h), 255)
|
135 |
+
effective_overlap_x = min(overlap, tile_w)
|
136 |
+
effective_overlap_y = min(overlap, tile_h)
|
137 |
if x > 0:
|
138 |
+
for i in range(effective_overlap_x):
|
139 |
for j in range(tile_h):
|
140 |
mask.putpixel((i, j), int(255 * (i / overlap)))
|
141 |
if y > 0:
|
142 |
for i in range(tile_w):
|
143 |
+
for j in range(effective_overlap_y):
|
144 |
mask.putpixel((i, j), int(255 * (j / overlap)))
|
145 |
output.paste(gen_tile, paste_box, mask)
|
146 |
else:
|
|
|
490 |
""")
|
491 |
|
492 |
if __name__ == "__main__":
|
493 |
+
demo.queue().launch(share=True, server_name="0.0.0.0", server_port=7860)
|
|