mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
inpaining support completed, invert mask added
This commit is contained in:
parent
23339ace9b
commit
27f575dc83
4 changed files with 12 additions and 2 deletions
|
@ -264,6 +264,7 @@ class sd_generation_inputs(ctypes.Structure):
|
|||
("negative_prompt", ctypes.c_char_p),
|
||||
("init_images", ctypes.c_char_p),
|
||||
("mask", ctypes.c_char_p),
|
||||
("flip_mask", ctypes.c_bool),
|
||||
("denoising_strength", ctypes.c_float),
|
||||
("cfg_scale", ctypes.c_float),
|
||||
("sample_steps", ctypes.c_int),
|
||||
|
@ -1486,6 +1487,7 @@ def sd_generate(genparams):
|
|||
init_images_arr = genparams.get("init_images", [])
|
||||
init_images = ("" if (not init_images_arr or len(init_images_arr)==0 or not init_images_arr[0]) else init_images_arr[0])
|
||||
mask = genparams.get("mask", "")
|
||||
flip_mask = genparams.get("inpainting_mask_invert", 0)
|
||||
denoising_strength = tryparsefloat(genparams.get("denoising_strength", 0.6))
|
||||
cfg_scale = tryparsefloat(genparams.get("cfg_scale", 5))
|
||||
sample_steps = tryparseint(genparams.get("steps", 20))
|
||||
|
@ -1523,6 +1525,7 @@ def sd_generate(genparams):
|
|||
inputs.negative_prompt = negative_prompt.encode("UTF-8")
|
||||
inputs.init_images = init_images.encode("UTF-8")
|
||||
inputs.mask = "".encode("UTF-8") if not mask else mask.encode("UTF-8")
|
||||
inputs.flip_mask = flip_mask
|
||||
inputs.cfg_scale = cfg_scale
|
||||
inputs.denoising_strength = denoising_strength
|
||||
inputs.sample_steps = sample_steps
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue