-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: ADetailer crashes because of a NoneType error #653
Comments
@DiegoRRR ¡Hola! Soy Dosu, un bot que puede ayudarte a solucionar errores, responder preguntas y convertirte en un colaborador. Estoy aquí para ayudarte mientras esperas a un mantenedor humano. The To fix this issue, ensure that the mask is correctly created and passed to the
Here is the modified def get_i2i_p(self, p, args: ADetailerArgs, image):
seed, subseed = self.get_seed(p)
width, height = self.get_width_height(p, args)
steps = self.get_steps(p, args)
cfg_scale = self.get_cfg_scale(p, args)
initial_noise_multiplier = self.get_initial_noise_multiplier(p, args)
sampler_name = self.get_sampler(p, args)
override_settings = self.get_override_settings(p, args)
version_args = {}
if schedulers:
version_args.update(self.get_scheduler(p, args))
# Create the mask
bboxes = self.get_bounding_boxes(p) # Assuming this method exists to get bounding boxes
mask = create_mask_from_bbox(bboxes, (width, height))
i2i = StableDiffusionProcessingImg2Img(
init_images=[image],
resize_mode=0,
denoising_strength=args.ad_denoising_strength,
mask=mask, # Pass the created mask here
mask_blur=args.ad_mask_blur,
inpainting_fill=1,
inpaint_full_res=args.ad_inpaint_only_masked,
inpaint_full_res_padding=args.ad_inpaint_only_masked_padding,
inpainting_mask_invert=0,
initial_noise_multiplier=initial_noise_multiplier,
sd_model=p.sd_model,
outpath_samples=p.outpath_samples,
outpath_grids=p.outpath_grids,
prompt="", # replace later
negative_prompt="",
styles=p.styles,
seed=seed,
subseed=subseed,
subseed_strength=p.subseed_strength,
seed_resize_from_h=p.seed_resize_from_h,
seed_resize_from_w=p.seed_resize_from_w,
sampler_name=sampler_name,
batch_size=1,
n_iter=1,
steps=steps,
cfg_scale=cfg_scale,
width=width,
height=height,
restore_faces=args.ad_restore_face,
tiling=p.tiling,
extra_generation_params=copy_extra_params(p.extra_generation_params),
do_not_save_samples=True,
do_not_save_grid=True,
override_settings=override_settings,
**version_args,
)
i2i.cached_c = [None, None]
i2i.cached_uc = [None, None]
i2i.scripts, i2i.script_args = self.script_filter(p, args)
i2i._ad_disabled = True
i2i._ad_inner = True
if args.ad_controlnet_model != "Passthrough" and controlnet_type != "forge":
self.disable_controlnet_units(i2i.script_args)
if args.ad_controlnet_model not in ["None", "Passthrough"]:
self.update_controlnet_args(i2i, args)
elif args.ad_controlnet_model == "None":
i2i.control_net_enabled = False
return i2i This modification ensures that the |
@dosu : Thanks. Ok, I edited the file "extensions\adetailer\scripts!adetailer.py" and replaced the definition of the
|
The new error you're encountering seems to be related to the Here is the corrected from some_module import schedulers, controlnet_type # Ensure these are correctly imported from the appropriate module
def get_i2i_p(self, p, args: ADetailerArgs, image):
seed, subseed = self.get_seed(p)
width, height = self.get_width_height(p, args)
steps = self.get_steps(p, args)
cfg_scale = self.get_cfg_scale(p, args)
initial_noise_multiplier = self.get_initial_noise_multiplier(p, args)
sampler_name = self.get_sampler(p, args)
override_settings = self.get_override_settings(p, args)
version_args = {}
if schedulers:
version_args.update(self.get_scheduler(p, args))
# Create the mask
bboxes = self.get_bounding_boxes(p) # Assuming this method exists to get bounding boxes
mask = create_mask_from_bbox(bboxes, (width, height))
i2i = StableDiffusionProcessingImg2Img(
init_images=[image],
resize_mode=0,
denoising_strength=args.ad_denoising_strength,
mask=mask, # Pass the created mask here
mask_blur=args.ad_mask_blur,
inpainting_fill=1,
inpaint_full_res=args.ad_inpaint_only_masked,
inpaint_full_res_padding=args.ad_inpaint_only_masked_padding,
inpainting_mask_invert=0,
initial_noise_multiplier=initial_noise_multiplier,
sd_model=p.sd_model,
outpath_samples=p.outpath_samples,
outpath_grids=p.outpath_grids,
prompt="", # replace later
negative_prompt="",
styles=p.styles,
seed=seed,
subseed=subseed,
subseed_strength=p.subseed_strength,
seed_resize_from_h=p.seed_resize_from_h,
seed_resize_from_w=p.seed_resize_from_w,
sampler_name=sampler_name,
batch_size=1,
n_iter=1,
steps=steps,
cfg_scale=cfg_scale,
width=width,
height=height,
restore_faces=args.ad_restore_face,
tiling=p.tiling,
extra_generation_params=copy_extra_params(p.extra_generation_params),
do_not_save_samples=True,
do_not_save_grid=True,
override_settings=override_settings,
**version_args,
)
i2i.cached_c = [None, None]
i2i.cached_uc = [None, None]
i2i.scripts, i2i.script_args = self.script_filter(p, args)
i2i._ad_disabled = True
i2i._ad_inner = True
if args.ad_controlnet_model != "Passthrough" and controlnet_type != "forge":
self.disable_controlnet_units(i2i.script_args)
if args.ad_controlnet_model not in ["None", "Passthrough"]:
self.update_controlnet_args(i2i, args)
elif args.ad_controlnet_model == "None":
i2i.control_net_enabled = False
return i2i Ensure that |
@dosu : I don't know python but I think There is no error anymore but it does nothing. I check the ADetailer checkbox. "face_yolov8n.pt" is selected. I leave all settings to default, and I generate. But the picture is exactly the same as without ADetailer, no improvement on the generated face. |
The error you really should focus on is not the NoneType error, but rather the following:
This shows that there was a problem with the package installation. Try a clean reinstall. |
Describe the bug
I just installed ADetailer and let it download its file.
ADetailer crashes because of a NoneType error.
Steps to reproduce
Screenshots
No response
Console logs, from start to end.
List of installed extensions
LDSR built-in None
Lora built-in None
ScuNET built-in None
SwinIR built-in None
canvas-zoom-and-pan built-in None
extra-options-section built-in None
forge_legacy_preprocessors built-in None
forge_preprocessor_inpaint built-in None
forge_preprocessor_marigold built-in None
forge_preprocessor_normalbae built-in None
forge_preprocessor_recolor built-in None
forge_preprocessor_reference built-in None
forge_preprocessor_revision built-in None
forge_preprocessor_tile built-in None
mobile built-in None
prompt-bracket-checker built-in None
sd_forge_controlllite built-in None
sd_forge_controlnet built-in None
sd_forge_controlnet_example built-in None
sd_forge_dynamic_thresholding built-in None
sd_forge_fooocus_inpaint built-in None
sd_forge_freeu built-in None
sd_forge_hypertile built-in None
sd_forge_ipadapter built-in None
sd_forge_kohya_hrfix built-in None
sd_forge_latent_modifier built-in None
sd_forge_multidiffusion built-in None
sd_forge_neveroom built-in None
sd_forge_photomaker built-in None
sd_forge_sag built-in None
sd_forge_stylealign built-in None
sd_forge_svd built-in None
sd_forge_z123 built-in None
soft-inpainting built-in None
adetailer https://github.com/Bing-su/adetailer main a7d96113 2024-06-16 02:32:49 unknown
sd-forge-layerdiffuse https://github.com/layerdiffusion/sd-forge-layerdiffuse main e4d5060e 2024-03-08 15:36:24 unknown
The text was updated successfully, but these errors were encountered: