Skip to content
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]: Applying adetailer on forge for SD 1.5 models would produce "AttributeError: 'ControlNetForForgeOfficial' object has no attribute 'current_params'" #756

Open
ryukbk opened this issue Dec 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ryukbk
Copy link

ryukbk commented Dec 17, 2024

Describe the bug

When using adetailer for SD 1.5 models on stable-diffusion-webui-forge , I get this error "AttributeError: 'ControlNetForForgeOfficial' object has no attribute 'current_params'" from controlnet. For SDXL models, no errors are issued.

*** Error running process_before_every_sampling: C:\Users\test\Documents\webui_forge\webui\extensions-builtin\sd_forge_controlnet\scripts\controlnet.py
    Traceback (most recent call last):
      File "C:\Users\test\Documents\webui_forge\webui\modules\scripts.py", line 892, in process_before_every_sampling
        script.process_before_every_sampling(p, *script_args, **kwargs)
      File "C:\Users\test\Documents\webui_forge\system\python\lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context
        return func(*args, **kwargs)
      File "C:\Users\test\Documents\webui_forge\webui\extensions-builtin\sd_forge_controlnet\scripts\controlnet.py", line 561, in process_before_every_sampling
        self.process_unit_before_every_sampling(p, unit, self.current_params[i], *args, **kwargs)
    AttributeError: 'ControlNetForForgeOfficial' object has no attribute 'current_params'

Steps to reproduce

  1. Load a SD 1.5 checkpoint on stable-diffusion-webui-forge
  2. Enable adetailer with face_yolov8n.pt (or any models) and enter something in the adetailer prompt
  3. Generate an image

Screenshots

No response

Console logs, from start to end.

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: f2.0.1v1.10.1-previous-633-ge073e4ec
Commit hash: e073e4ec581c803cbc71003f6d3261d37ec43840
Launching Web UI with arguments: --port 7861 --opt-sdp-no-mem-attention --ckpt-dir 'C:\Users\test\Documents\stable-diffusion-webui-AUTOMATIC1111\/models/Stable-diffusion' --hypernetwork-dir 'C:\Users\test\Documents\stable-diffusion-webui-AUTOMATIC1111\/models/hypernetworks' --embeddings-dir 'C:\Users\test\Documents\stable-diffusion-webui-AUTOMATIC1111\/embeddings' --lora-dir 'C:\Users\test\Documents\stable-diffusion-webui-AUTOMATIC1111\/models/Lora' --vae-dir 'C:\Users\test\Documents\stable-diffusion-webui-AUTOMATIC1111\/models/VAE' --controlnet-dir 'C:\Users\test\Documents\stable-diffusion-webui-AUTOMATIC1111\/models/ControlNet' --esrgan-models-path 'C:\Users\test\Documents\stable-diffusion-webui-AUTOMATIC1111\/models/ESRGAN'
Total VRAM 24564 MB, total RAM 65327 MB
pytorch version: 2.5.1+cu124
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 4090 : native
Hint: your device supports --cuda-malloc for potential speed improvements.
VAE dtype preferences: [torch.bfloat16, torch.float32] -> torch.bfloat16
CUDA Using Stream: False
C:\Users\test\Documents\webui_forge\system\python\lib\site-packages\transformers\utils\hub.py:128: FutureWarning: Using `TRANSFORMERS_CACHE` is deprecated and will be removed in v5 of Transformers. Use `HF_HOME` instead.
  warnings.warn(
Using pytorch cross attention
Using pytorch attention for VAE
ControlNet preprocessor location: C:\Users\test\Documents\webui_forge\webui\models\ControlNetPreprocessor
[-] ADetailer initialized. version: 24.11.1, num models: 37
C:\Users\test\Documents\webui_forge\webui\modules_forge\patch_basic.py:38: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  result = original_loader(*args, **kwargs)


(...)

*** Error running process_before_every_sampling: C:\Users\test\Documents\webui_forge\webui\extensions-builtin\sd_forge_controlnet\scripts\controlnet.py
    Traceback (most recent call last):
      File "C:\Users\test\Documents\webui_forge\webui\modules\scripts.py", line 892, in process_before_every_sampling
        script.process_before_every_sampling(p, *script_args, **kwargs)
      File "C:\Users\test\Documents\webui_forge\system\python\lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context
        return func(*args, **kwargs)
      File "C:\Users\test\Documents\webui_forge\webui\extensions-builtin\sd_forge_controlnet\scripts\controlnet.py", line 561, in process_before_every_sampling
        self.process_unit_before_every_sampling(p, unit, self.current_params[i], *args, **kwargs)
    AttributeError: 'ControlNetForForgeOfficial' object has no attribute 'current_params'

List of installed extensions

ScuNET built-in None
SwinIR 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
forge_space_animagine_xl_31 built-in None
forge_space_birefnet built-in None
forge_space_example built-in None
forge_space_florence_2 built-in None
forge_space_geowizard built-in None
forge_space_iclight built-in None
forge_space_idm_vton built-in None
forge_space_illusion_diffusion built-in None
forge_space_photo_maker_v2 built-in None
forge_space_sapiens_normal 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_dynamic_thresholding built-in None
sd_forge_fooocus_inpaint built-in None
sd_forge_freeu 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_lora built-in None
sd_forge_multidiffusion built-in None
sd_forge_neveroom built-in None
sd_forge_perturbed_attention built-in None
sd_forge_sag built-in None
sd_forge_stylealign built-in None
soft-inpainting built-in None
adetailer https://github.com/Bing-su/adetailer main c48bdbd8 2024-12-07 20:10:25 unknown

@ryukbk ryukbk added the bug Something isn't working label Dec 17, 2024
Copy link

dosubot bot commented Dec 17, 2024

@ryukbk Hello there! I'm here to help you with any bugs, questions, or contributions. Let me know how I can assist you!

The error "AttributeError: 'ControlNetForForgeOfficial' object has no attribute 'current_params'" indicates that the current_params attribute is missing or not properly initialized in the ControlNetForForgeOfficial class when using SD 1.5 models. This issue does not occur with SDXL models, suggesting a potential compatibility problem or a missing implementation specific to SD 1.5 models.

To address this, you might need to check the implementation of the ControlNetForForgeOfficial class to ensure that the current_params attribute is defined and initialized correctly. This could involve reviewing the initialization process or any conditional logic that might skip setting this attribute for SD 1.5 models. If the attribute is supposed to be dynamically set, ensure that the logic for setting it is executed for SD 1.5 models as well.

If the issue persists, consider looking for updates or patches in the repository or related discussions that might address this specific compatibility issue.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant