Spaces:
Runtime error
Runtime error
Update worker_runpod.py
Browse files- worker_runpod.py +3 -3
worker_runpod.py
CHANGED
@@ -124,17 +124,17 @@ def generate(input):
|
|
124 |
blending_mode = values['blending_mode']
|
125 |
blending_blend_percentage = values['blending_blend_percentage']
|
126 |
vram = values['vram']
|
|
|
|
|
|
|
127 |
|
128 |
output_image, output_mask = nodes.LoadImage().load_image(input_image)
|
129 |
output_image_s = ImageScaleToTotalPixels.upscale(image=output_image, upscale_method="nearest-exact", megapixels=1.0)[0]
|
130 |
image_width = GetImageSizeAndCount.getsize(output_image_s)["result"][1]
|
131 |
image_height = GetImageSizeAndCount.getsize(output_image_s)["result"][2]
|
132 |
-
upscale_mp = 4
|
133 |
w_math = ceil((image_width * upscale_mp) / 8) * 8
|
134 |
h_math = ceil((image_height * upscale_mp) / 8) * 8
|
135 |
-
w_tiles = 4
|
136 |
tile_width = ceil((w_math / w_tiles) / 8) * 8
|
137 |
-
h_tiles = 4
|
138 |
tile_height = ceil((h_math / h_tiles) / 8) * 8
|
139 |
tile_batch_size = floor((vram-3) / ((tile_width*tile_height) / 1000000))
|
140 |
upscale_image = ImageScaleBy.upscale(image=output_image, upscale_method="bilinear", scale_by=1.0)[0]
|
|
|
124 |
blending_mode = values['blending_mode']
|
125 |
blending_blend_percentage = values['blending_blend_percentage']
|
126 |
vram = values['vram']
|
127 |
+
upscale_mp = values['upscale_mp']
|
128 |
+
w_tiles = values['w_tiles']
|
129 |
+
h_tiles = values['h_tiles']
|
130 |
|
131 |
output_image, output_mask = nodes.LoadImage().load_image(input_image)
|
132 |
output_image_s = ImageScaleToTotalPixels.upscale(image=output_image, upscale_method="nearest-exact", megapixels=1.0)[0]
|
133 |
image_width = GetImageSizeAndCount.getsize(output_image_s)["result"][1]
|
134 |
image_height = GetImageSizeAndCount.getsize(output_image_s)["result"][2]
|
|
|
135 |
w_math = ceil((image_width * upscale_mp) / 8) * 8
|
136 |
h_math = ceil((image_height * upscale_mp) / 8) * 8
|
|
|
137 |
tile_width = ceil((w_math / w_tiles) / 8) * 8
|
|
|
138 |
tile_height = ceil((h_math / h_tiles) / 8) * 8
|
139 |
tile_batch_size = floor((vram-3) / ((tile_width*tile_height) / 1000000))
|
140 |
upscale_image = ImageScaleBy.upscale(image=output_image, upscale_method="bilinear", scale_by=1.0)[0]
|