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

"NoneType" object is not subscriptable #36

Closed
Yomama232 opened this issue Feb 28, 2024 · 5 comments
Closed

"NoneType" object is not subscriptable #36

Yomama232 opened this issue Feb 28, 2024 · 5 comments

Comments

@Yomama232
Copy link

Yomama232 commented Feb 28, 2024

*** Error executing callback cfg_denoiser_callback for D:\stable-diffusion-webui\webui\extensions\sd-webui-negpip\scripts\negpip.py
Traceback (most recent call last):
File "D:\stable-diffusion-webui\webui\modules\script_callbacks.py", line 216, in cfg_denoiser_callback
c.callback(params)
File "D:\stable-diffusion-webui\webui\extensions\sd-webui-negpip\scripts\negpip.py", line 268, in denoiser_callback
for step, regions in self.hr_conds_all[0] if self.hrp and self.hr else self.conds_all[0]:
TypeError: 'NoneType' object is not subscriptable

SD web-UI v1.6.0
I'm using RTX 4060ti 16gb and i5-13400F

There are 2 ways I use this extension:
1. Positive prompt: (word:-1.8) *It said NegPiP Active: True but still shows the error*
2. Negative prompt: (word:-1.8) *It said NegPiP Active: True but still shows the error*

I don't know if it still works even if the error happens
@SysVR
Copy link

SysVR commented Mar 11, 2024

webui_forge_cu121_torch21
Version: f0.0.17v1.8.0rc-latest-276-g29be1da7
Commit hash: 29be1da7cf2b5dccfc70fbdd33eb35c56a31ffb7
クリーンインストール(解凍後アップデート、その後NegPIPのみインストールした状態)
でこのエラーが発生します。

NegPiP : Not Active
にしてもプロンプトに
(sky:-1.0)
等とマイナスがあるとエラーが発生します。
この場合webui_forgeを再起動すると直ります。

以下フルログです。
*入力プロンプト:cat, (sky:-1.0)

@SysVR
Copy link

SysVR commented Mar 11, 2024

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: f0.0.17v1.8.0rc-latest-276-g29be1da7
Commit hash: 29be1da7cf2b5dccfc70fbdd33eb35c56a31ffb7
Launching Web UI with arguments:
Total VRAM 8192 MB, total RAM 32658 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce GTX 1070 : native
VAE dtype: torch.float32
CUDA Stream Activated: False
Using pytorch cross attention
ControlNet preprocessor location: R:\webui_forge_cu121_torch21\webui\models\ControlNetPreprocessor
Loading weights [15012c538f] from R:\webui_forge_cu121_torch21\webui\models\Stable-diffusion\realisticVisionV51_v51VAE.safetensors
2024-03-12 05:53:05,349 - ControlNet - INFO - ControlNet UI callback registered.
Running on local URL: http://127.0.0.1:7860
model_type EPS
UNet ADM Dimension 0

To create a public link, set share=True in launch().
Startup time: 13.7s (prepare environment: 3.0s, import torch: 3.7s, import gradio: 0.8s, setup paths: 0.7s, other imports: 0.5s, load scripts: 3.9s, create ui: 0.7s, gradio launch: 0.3s).
Using pytorch attention in VAE
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
Using pytorch attention in VAE
extra {'cond_stage_model.clip_l.logit_scale', 'cond_stage_model.clip_l.text_projection'}
To load target model SD1ClipModel
Begin to load 1 model
[Memory Management] Current Free GPU Memory (MB) = 7216.9990234375
[Memory Management] Model Memory (MB) = 454.2076225280762
[Memory Management] Minimal Inference Memory (MB) = 1024.0
[Memory Management] Estimated Remaining GPU Memory (MB) = 5738.791400909424
Moving model(s) has taken 0.10 seconds
Model loaded in 3.2s (load weights from disk: 0.7s, forge load real models: 2.2s, calculate empty prompt: 0.3s).
NegPiP enable, Positive:[2],Negative:None
To load target model BaseModel
Begin to load 1 model
[Memory Management] Current Free GPU Memory (MB) = 6871.99755859375
[Memory Management] Model Memory (MB) = 3278.8199005126953
[Memory Management] Minimal Inference Memory (MB) = 1024.0
[Memory Management] Estimated Remaining GPU Memory (MB) = 2569.1776580810547
Moving model(s) has taken 0.60 seconds
0%| | 0/20 [00:00<?, ?it/s]
Traceback (most recent call last):
File "R:\webui_forge_cu121_torch21\webui\modules_forge\main_thread.py", line 37, in loop
task.work()
File "R:\webui_forge_cu121_torch21\webui\modules_forge\main_thread.py", line 26, in work
self.result = self.func(*self.args, **self.kwargs)
File "R:\webui_forge_cu121_torch21\webui\modules\txt2img.py", line 111, in txt2img_function
processed = processing.process_images(p)
File "R:\webui_forge_cu121_torch21\webui\modules\processing.py", line 752, in process_images
res = process_images_inner(p)
File "R:\webui_forge_cu121_torch21\webui\modules\processing.py", line 922, in process_images_inner
samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
File "R:\webui_forge_cu121_torch21\webui\modules\processing.py", line 1275, in sample
samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
File "R:\webui_forge_cu121_torch21\webui\modules\sd_samplers_kdiffusion.py", line 251, in sample
samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
File "R:\webui_forge_cu121_torch21\webui\modules\sd_samplers_common.py", line 263, in launch_sampling
return func()
File "R:\webui_forge_cu121_torch21\webui\modules\sd_samplers_kdiffusion.py", line 251, in
samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, **extra_params_kwargs))
File "R:\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "R:\webui_forge_cu121_torch21\webui\repositories\k-diffusion\k_diffusion\sampling.py", line 594, in sample_dpmpp_2m
denoised = model(x, sigmas[i] * s_in, **extra_args)
File "R:\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self.call_impl(*args, **kwargs)
File "R:\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\nn\modules\module.py", line 1527, in call_impl
return forward_call(*args, **kwargs)
File "R:\webui_forge_cu121_torch21\webui\modules\sd_samplers_cfg_denoiser.py", line 182, in forward
denoised = forge_sampler.forge_sample(self, denoiser_params=denoiser_params,
File "R:\webui_forge_cu121_torch21\webui\modules_forge\forge_sampler.py", line 88, in forge_sample
denoised = sampling_function(model, x, timestep, uncond, cond, cond_scale, model_options, seed)
File "R:\webui_forge_cu121_torch21\webui\ldm_patched\modules\samplers.py", line 289, in sampling_function
cond_pred, uncond_pred = calc_cond_uncond_batch(model, cond, uncond
, x, timestep, model_options)
File "R:\webui_forge_cu121_torch21\webui\ldm_patched\modules\samplers.py", line 258, in calc_cond_uncond_batch
output = model.apply_model(input_x, timestep
, **c).chunk(batch_chunks)
File "R:\webui_forge_cu121_torch21\webui\ldm_patched\modules\model_base.py", line 90, in apply_model
model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds).float()
File "R:\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "R:\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "R:\webui_forge_cu121_torch21\webui\ldm_patched\ldm\modules\diffusionmodules\openaimodel.py", line 867, in forward
h = forward_timestep_embed(module, h, emb, context, transformer_options, time_context=time_context, num_video_frames=num_video_frames, image_only_indicator=image_only_indicator)
File "R:\webui_forge_cu121_torch21\webui\ldm_patched\ldm\modules\diffusionmodules\openaimodel.py", line 55, in forward_timestep_embed
x = layer(x, context, transformer_options)
File "R:\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "R:\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "R:\webui_forge_cu121_torch21\webui\ldm_patched\ldm\modules\attention.py", line 620, in forward
x = block(x, context=context[i], transformer_options=transformer_options)
File "R:\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "R:\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "R:\webui_forge_cu121_torch21\webui\ldm_patched\ldm\modules\attention.py", line 447, in forward
return checkpoint(self._forward, (x, context, transformer_options), self.parameters(), self.checkpoint)
File "R:\webui_forge_cu121_torch21\webui\ldm_patched\ldm\modules\diffusionmodules\util.py", line 194, in checkpoint
return func(*inputs)
File "R:\webui_forge_cu121_torch21\webui\ldm_patched\ldm\modules\attention.py", line 547, in _forward
n = self.attn2(n, context=context_attn2, value=value_attn2, transformer_options=extra_options)
File "R:\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "R:\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
TypeError: hook_forward..forward() got an unexpected keyword argument 'transformer_options'
hook_forward..forward() got an unexpected keyword argument 'transformer_options'
*** Error completing request
*** Arguments: ('task(ib162lzb34vd6k3)', <gradio.routes.Request object at 0x000001D0C55546D0>, 'cat, (sky:-1.0)', '', [], 20, 'DPM++ 2M Karras', 1, 1, 7, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], 0, False, '', 0.8, -1, False, -1, 0, 0, 0, True, ControlNetUnit(input_mode=<InputMode.SIMPLE: 'simple'>, use_preview_as_input=False, batch_image_dir='', batch_mask_dir='', batch_input_gallery=[], batch_mask_gallery=[], generated_image=None, mask_image=None, hr_option='Both', enabled=False, module='None', model='None', weight=1, image=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', save_detected_map=True), ControlNetUnit(input_mode=<InputMode.SIMPLE: 'simple'>, use_preview_as_input=False, batch_image_dir='', batch_mask_dir='', batch_input_gallery=[], batch_mask_gallery=[], generated_image=None, mask_image=None, hr_option='Both', enabled=False, module='None', model='None', weight=1, image=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', save_detected_map=True), ControlNetUnit(input_mode=<InputMode.SIMPLE: 'simple'>, use_preview_as_input=False, batch_image_dir='', batch_mask_dir='', batch_input_gallery=[], batch_mask_gallery=[], generated_image=None, mask_image=None, hr_option='Both', enabled=False, module='None', model='None', weight=1, image=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', save_detected_map=True), False, 7, 1, 'Constant', 0, 'Constant', 0, 1, 'enable', 'MEAN', 'AD', 1, False, 1.01, 1.02, 0.99, 0.95, False, 0.5, 2, False, 256, 2, 0, False, False, 3, 2, 0, 0.35, True, 'bicubic', 'bicubic', False, 0, 'anisotropic', 0, 'reinhard', 100, 0, 'subtract', 0, 0, 'gaussian', 'add', 0, 100, 127, 0, 'hard_clamp', 5, 0, 'None', 'None', False, 'MultiDiffusion', 768, 768, 64, 4, False, False, False, False, False, 'positive', 'comma', 0, False, False, 'start', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, False, False, False, 0, False) {}
Traceback (most recent call last):
File "R:\webui_forge_cu121_torch21\webui\modules\call_queue.py", line 57, in f
res = list(func(*args, **kwargs))
TypeError: 'NoneType' object is not iterable


@Heather95
Copy link

@SysVR

NegPiP does not work in Forge newest commit.
Please go back to older commit b9705c5
If you don't know how to do that, you can install Stability Matrix.

DeepLで翻訳
NegPiP は Forge の最新コミットでは動作しません。
古いコミット b9705c5 に戻ってください。
その方法がわからない場合は、Stability Matrix をインストールしてください。スクリーンショットをご覧ください。

image

@SysVR
Copy link

SysVR commented Mar 14, 2024

@Heather95 thank you.
修正されるまで、またはForgeに同様の機能が追加されるまで私はこれを利用します。

DeepL
I will use this until it is fixed or a similar feature is added to Forge.

hako-mikan added a commit that referenced this issue Apr 1, 2024
@hako-mikan
Copy link
Owner

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants