mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
fix: Handle cases where tile size > image size
This commit is contained in:
committed by
psychedelicious
parent
f718de98f8
commit
021f77e35e
@@ -578,11 +578,14 @@ class ColorMapImageProcessorInvocation(ImageProcessorInvocation):
|
||||
image = np.array(image, dtype=np.uint8)
|
||||
height, width = image.shape[:2]
|
||||
|
||||
width_tile_size = min(self.color_map_tile_size, width)
|
||||
height_tile_size = min(self.color_map_tile_size, height)
|
||||
|
||||
color_map = cv2.resize(
|
||||
image,
|
||||
(width // self.color_map_tile_size, height // self.color_map_tile_size),
|
||||
(width // width_tile_size, height // height_tile_size),
|
||||
interpolation=cv2.INTER_CUBIC,
|
||||
)
|
||||
color_map = cv2.resize(color_map, (width, height), interpolation=cv2.INTER_NEAREST)
|
||||
color_map = Image.fromarray(color_map)
|
||||
color_map = Image.fromarray(color_map)
|
||||
return color_map
|
||||
|
||||
Reference in New Issue
Block a user