mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fill color is parameterized
This commit is contained in:
parent
6556b200b5
commit
d3d24fa816
@ -184,6 +184,7 @@ class Inpaint(Img2Img):
|
|||||||
infill_method = None,
|
infill_method = None,
|
||||||
inpaint_width=None,
|
inpaint_width=None,
|
||||||
inpaint_height=None,
|
inpaint_height=None,
|
||||||
|
inpaint_fill:tuple(int)=(0x7F, 0x7F, 0x7F, 0xFF),
|
||||||
attention_maps_callback=None,
|
attention_maps_callback=None,
|
||||||
**kwargs):
|
**kwargs):
|
||||||
"""
|
"""
|
||||||
@ -211,7 +212,7 @@ class Inpaint(Img2Img):
|
|||||||
tile_size = tile_size
|
tile_size = tile_size
|
||||||
)
|
)
|
||||||
elif infill_method == 'solid':
|
elif infill_method == 'solid':
|
||||||
solid_bg = PIL.Image.new("RGBA", init_image.size, (0x7F, 0x7F, 0x7F, 0xFF))
|
solid_bg = PIL.Image.new("RGBA", init_image.size, inpaint_fill)
|
||||||
init_filled = PIL.Image.alpha_composite(solid_bg, init_image)
|
init_filled = PIL.Image.alpha_composite(solid_bg, init_image)
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Non-supported infill type {infill_method}", infill_method)
|
raise ValueError(f"Non-supported infill type {infill_method}", infill_method)
|
||||||
|
Loading…
Reference in New Issue
Block a user