mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-11 07:19:10 +02:00
inpaining support completed, invert mask added
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user