deforum / deforum/sd-webui-deforum

[Bug]: Error: 'types.SimpleNamespace' object has no attribute 'cn_1_weight'

Open
#811 22 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
2.9k
Forks
407
PR merge metrics
No merged PRs in 30d

Description

### Have you read the latest version of the FAQ?

- [X] I have visited the FAQ page right now and my issue is not present there

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits of both this extension and the webui

### Are you using the latest version of the Deforum extension?

- [X] I have Deforum updated to the lastest version and I still have the issue.

### What happened?

Cannot generate anything using Deforum. I get

```
User friendly error message:
Error: 'types.SimpleNamespace' object has no attribute 'cn_1_weight'. Check your schedules/ init values please. Also make sure you don't have a backwards slash in any of your PATHs - use / instead of \.
```

### Steps to reproduce the problem

1. Go to .... Deforum tab on stable webui
2. Press .... Generate
3. Check log

### What should have happened/how would you fix it?

The error message provided indicates that there is an attempt to access an attribute named cn_1_weight in a types.SimpleNamespace object, but this attribute does not exist. This error is likely caused by a typo or a missing initialization of the attribute in the code.
To resolve this issue, maybe:
Check the code where the script is initializing the types.SimpleNamespace object and ensure that the cn_1_weight attribute is properly initialized.
Verify that there are no typos in the attribute name when accessing it in the code.

### Torch version

torch: 2.0.0+cu118

### On which platform are you launching the webui with the extension?

_No response_

### Deforum settings

{
"W": 720,
"H": 1280,
"show_info_on_ui": true,
"tiling": false,
"restore_faces": false,
"seed_resize_from_w": 0,
"seed_resize_from_h": 0,
"seed": -1,
"sampler": "DPM++ SDE Karras",
"steps": 25,
"batch_name": "Deforum_{timestring}",
"seed_behavior": "iter",
"seed_iter_N": 1,
"use_init": true,
"strength": 0.8,
"strength_0_no_init": true,
"init_image": "D:\\A1111 Web UI Autoinstaller\\Stable.jpg",
"use_mask": false,
"use_alpha_as_mask": false,
"mask_file": "https://deforum.github.io/a1/M1.jpg",
"invert_mask": false,
"mask_contrast_adjust": 1.0,
"mask_brightness_adjust": 1.0,
"overlay_mask": true,
"mask_overlay_blur": 4,
"fill": 1,
"full_res_mask": true,
"full_res_mask_padding": 4,
"reroll_blank_frames": "reroll",
"reroll_patience": 10.0,
"prompts": {
"0": "masterpiece, A super powerful football player, showing immense strength, kicks a ball with tremendous force on a futuristic stadium. The scene is filled with energy and excitement as cheering fans surround the player. The lighting is vibrant, with dynamic colors illuminating the atmosphere. The artwork is in the style of Banksy, resembling a graffiti mural created with spray paint on a concrete wall. The colors used are bold and contrasting, creating a visually captivating composition.",
"30": "masterpiece, A super powerful football player, scoring an incredible goal in a stadium filled with fans, vibrant lighting, graffiti art style, spray paint on concrete, bold and contrasting colors. (Best quality:1.5, masterpiece:1.5). ",
"60": "A super powerful football player, leaping in mid-air for a header, surrounded by a majestic landscape, soft golden lighting, realistic art style, oil painting on canvas, warm and earthy tones. (Best quality:1.5, masterpiece:1.5). ",
"90": "A super powerful football player, tackling opponents with strength and agility, set in a futuristic cityscape, neon lighting, cyberpunk art style, digital painting, cool tones with pops of vibrant colors. (Best quality:1.5, masterpiece:1.5).",
"150": "A super powerful football player, scoring a goal, on a vibrant stadium field, surrounded by enthusiastic fans, under neon lights, with an urban graffiti art style, using spray paint on a concrete wall, creating a dynamic mural. (Best quality:1.5, masterpiece:1.5).",
"240": "A super powerful football player, dribbling the ball, in a futuristic stadium, with a panoramic view of a cityscape, lit by a dramatic sunset, showcasing an impressionist art style, reminiscent of Monet's paintings, using oil on canvas, capturing the energy and motion of the player. (Best quality:1.5, masterpiece:1.5).",
"350": "A super powerful football player, leaping in the air, in a magical enchanted forest, surrounded by mystical creatures, illuminated by soft moonlight, depicted in a fantasy art style inspired by artists like Alan Lee, using watercolor and ink, creating an ethereal and enchanting scene. (Best quality:1.5, masterpiece:1.5).",
"480": "A magical football player, casting spells while playing, in a mystical stadium surrounded by floating orbs, bathed in enchanting moonlight, with a surreal art style reminiscent of Salvador Dalí's work, using acrylic paints on canvas, creating a dreamlike composition. (Best quality:1.5, masterpiece:1.5)."
},
"animation_prompts_positive": "",
"animation_prompts_negative": "nsfw, nude, Cropped image, out of frame, draft, distorted face, poorly drawn hands, blurry, low-res, bad anatomy, grainy, beginner, amateur, watermark, cut off, underexposed, overexposed.",
"animation_mode": "3D",
"max_frames": 150,
"border": "wrap",
"angle": "0:(0)",
"zoom": "0:(1.0025+0.002*sin(1.25*3.14*t/30))",
"translation_x": "0:(0), 30:(15), 210:(15), 300:(0)",
"translation_y": "0:(0.2), 60:(10), 300:(15)",
"translation_z": "0:(1.75)",
"transform_center_x": "0:(0.5)",
"transform_center_y": "0:(0.5)",
"rotation_3d_x": "0:(0), 60:(0), 90:(0.5), 180:(0.5), 300:(0.5)",
"rotation_3d_y": "0:(0), 30:(-3.5), 90:(-2.5), 180:(-2.8), 300:(-2), 420:(0)",
"rotation_3d_z": "0:(0), 60:(0.2), 90:(0), 180:(-0.5), 300:(0), 420:(0.5), 500:(0.8)",
"enable_perspective_flip": false,
"perspective_flip_theta": "0:(0)",
"perspective_flip_phi": "0:(0)",
"perspective_flip_gamma": "0:(0)",
"perspective_flip_fv": "0:(53)",
"noise_schedule": "0:(-0.06*(cos(3.141*t/15)**100)+0.06)",
"strength_schedule": "0: (0.65), 25: (0.55)",
"contrast_schedule": "0: (1.0)",
"cfg_scale_schedule": "0: (7)",
"enable_steps_scheduling": false,
"steps_schedule": "0: (25)",
"fov_schedule": "0: (120)",
"aspect_ratio_schedule": "0: (1)",
"aspect_ratio_use_old_formula": false,
"near_schedule": "0: (200)",
"far_schedule": "0: (10000)",
"seed_schedule": "0:(s), 1:(-1), \"max_f-2\":(-1), \"max_f-1\":(s)",
"pix2pix_img_cfg_scale_schedule": "0:(1.5)",
"enable_subseed_scheduling": false,
"subseed_schedule": "0:(1)",
"subseed_strength_schedule": "0:(0)",
"enable_sampler_scheduling": false,
"sampler_schedule": "0: (\"Euler a\")",
"use_noise_mask": false,
"mask_schedule": "0: (\"{video_mask}\")",
"noise_mask_schedule": "0: (\"{video_mask}\")",
"enable_checkpoint_scheduling": false,
"checkpoint_schedule": "0: (\"model1.ckpt\"), 100: (\"model2.safetensors\")",
"enable_clipskip_scheduling": false,
"clipskip_schedule": "0: (2)",
"enable_noise_multiplier_scheduling": true,
"noise_multiplier_schedule": "0: (1.05)",
"resume_from_timestring": false,
"resume_timestring": null,
"enable_ddim_eta_scheduling": false,
"ddim_eta_schedule": "0:(0)",
"enable_ancestral_eta_scheduling": false,
"ancestral_eta_schedule": "0:(1)",
"amount_schedule": "0: (0.05)",
"kernel_schedule": "0: (5)",
"sigma_schedule": "0: (1.0)",
"threshold_schedule": "0: (0.0)",
"color_coherence": "LAB",
"color_coherence_image_path": "",
"color_coherence_video_every_N_frames": 1,
"color_force_grayscale": false,
"legacy_colormatch": true,
"diffusion_cadence": "2",
"optical_flow_cadence": "None",
"cadence_flow_factor_schedule": "0: (1)",
"optical_flow_redo_generation": "None",
"redo_flow_factor_schedule": "0: (1)",
"diffusion_redo": "0",
"noise_type": "perlin",
"perlin_octaves": 4,
"perlin_persistence": 0.5,
"use_depth_warping": true,
"depth_algorithm": "Midas-3-Hybrid",
"midas_weight": 0.2,
"padding_mode": "border",
"sampling_mode": "bicubic",
"save_depth_maps": false,
"video_init_path": "https://deforum.github.io/a1/V1.mp4",
"extract_nth_frame": 1,
"extract_from_frame": 0,
"extract_to_frame": -1,
"overwrite_extracted_frames": false,
"use_mask_video": false,
"video_mask_path": "https://deforum.github.io/a1/VM1.mp4",
"hybrid_comp_alpha_schedule": "0:(0.5)",
"hybrid_comp_mask_blend_alpha_schedule": "0:(0.5)",
"hybrid_comp_mask_contrast_schedule": "0:(1)",
"hybrid_comp_mask_auto_contrast_cutoff_high_schedule": "0:(100)",
"hybrid_comp_mask_auto_contrast_cutoff_low_schedule": "0:(0)",
"hybrid_flow_factor_schedule": "0:(1)",
"hybrid_generate_inputframes": false,
"hybrid_generate_human_masks": "None",
"hybrid_use_first_frame_as_init_image": true,
"hybrid_motion": "None",
"hybrid_motion_use_prev_img": false,
"hybrid_flow_consistency": false,
"hybrid_consistency_blur": 2,
"hybrid_flow_method": "RAFT",
"hybrid_composite": "None",
"hybrid_use_init_image": false,
"hybrid_comp_mask_type": "None",
"hybrid_comp_mask_inverse": false,
"hybrid_comp_mask_equalize": "None",
"hybrid_comp_mask_auto_contrast": false,
"hybrid_comp_save_extra_frames": false,
"parseq_manifest": null,
"parseq_use_deltas": true,
"use_looper": false,
"init_images": "{\n \"0\": \"https://deforum.github.io/a1/Gi1.png\",\n \"max_f/4-5\": \"https://deforum.github.io/a1/Gi2.png\",\n \"max_f/2-10\": \"https://deforum.github.io/a1/Gi3.png\",\n \"3*max_f/4-15\": \"https://deforum.github.io/a1/Gi4.jpg\",\n \"max_f-20\": \"https://deforum.github.io/a1/Gi1.png\"\n}",
"image_strength_schedule": "0:(0.75)",
"blendFactorMax": "0:(0.35)",
"blendFactorSlope": "0:(0.25)",
"tweening_frames_schedule": "0:(20)",
"color_correction_factor": "0:(0.075)",
"skip_video_creation": false,
"fps": 15,
"make_gif": false,
"delete_imgs": false,
"add_soundtrack": "None",
"soundtrack_path": "https://deforum.github.io/a1/A1.mp3",
"r_upscale_video": false,
"r_upscale_factor": "x2",
"r_upscale_model": "realesr-animevideov3",
"r_upscale_keep_imgs": true,
"store_frames_in_ram": false,
"frame_interpolation_engine": "None",
"frame_interpolation_x_amount": 2,
"frame_interpolation_slow_mo_enabled": false,
"frame_interpolation_slow_mo_amount": 2,
"frame_interpolation_keep_imgs": false,
"frame_interpolation_use_upscaled": false,
"sd_model_name": "revAnimated_v122.safetensors",
"sd_model_hash": "3f4fefd9",
"deforum_git_commit_id": "858c4dd6"
}

### Webui core settings

[https://drive.google.com/file/d/1VVA5BK-xmpfbpaz-FTXY39Yob47p_8H0/view?usp=sharing](url)

### Console logs

```Shell
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Loading A111 WebUI Launcher
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
i Settings file found, loading
→ Updating Settings File ✓
i Launcher Version 1.7.0
i Found a custom WebUI Config
i No Launcher launch options
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
→ Checking requirements :
i Python 3.10.6150.1013 found in registry: C:\Users\Saransh\AppData\Local\Programs\Python\Python310\
i Clearing PATH of any mention of Python
→ Adding python 3.10 to path ✓
i Git found and already in PATH: C:\Program Files\Git\cmd\git.exe
i Automatic1111 SD WebUI found: D:\A1111 Web UI Autoinstaller\stable-diffusion-webui
i One or more checkpoint models were found
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Loading Complete, opening launcher
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
i Arguments are now: --xformers
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↺ Updating Webui
✓ Done
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↺ Updating Extension: deforum-for-automatic1111-webui
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↺ Updating Extension: infinite-zoom-automatic1111-webui
✓ Done
i Arguments are now: --xformers
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WEBUI LAUNCHING VIA EMS LAUNCHER, EXIT THIS WINDOW TO STOP THE WEBUI
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
! Any error happening after 'commit hash : XXXX' is not related to the launcher. Please report them on Automatic1111's github instead :
☁ https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/new/choose
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Cancel
venv "D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.4.0
Commit hash: 394ffa7b0a7fff3ec484bcd084e673a8b301ccc8
Installing requirements

Installing requirements 1 for Infinite-Zoom

Launching Web UI with arguments: --autolaunch --xformers
=================================================================================
You are running xformers 0.0.17.
The program is tested to work with xformers 0.0.20.
To reinstall the desired version, run with commandline flag --reinstall-xformers.

Use --skip-version-check commandline argument to disable this check.
=================================================================================
Loading weights [4199bcdd14] from D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\models\Stable-diffusion\revAnimated_v122.safetensors
Creating model from config: D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
preload_extensions_git_metadata for 9 extensions took 0.16s
Running on local URL: http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
DiffusionWrapper has 859.52 M params.
Startup time: 9.8s (import torch: 2.8s, import gradio: 2.0s, import ldm: 0.7s, other imports: 1.5s, load scripts: 1.5s, create ui: 0.9s, gradio launch: 0.3s).
Applying attention optimization: xformers... done.
Textual inversion embeddings loaded(0):
Model loaded in 4.0s (load weights from disk: 1.0s, create model: 0.4s, apply weights to model: 0.9s, apply half(): 0.9s, move model to device: 0.7s).
reading custom settings from deforum_settings.txt
Traceback (most recent call last):
File "D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict
output = await app.get_blocks().process_api(
File "D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1323, in process_api
result = await self.call_function(
File "D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1051, in call_function
prediction = await anyio.to_thread.run_sync(
File "D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
result = context.run(func, *args)
File "D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers\gradio_funcs.py", line 237, in hide_optical_flow_cadence
return gr.update(visible=True) if cadence_value > 1 else gr.update(visible=False)
TypeError: '>' not supported between instances of 'str' and 'int'
Deforum extension for auto1111 webui, v2.4b
Git commit: 858c4dd6

*START OF TRACEBACK*
Traceback (most recent call last):
File "D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers\run_deforum.py", line 78, in run_deforum
render_animation(args, anim_args, video_args, parseq_args, loop_args, controlnet_args, root)
File "D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers\render.py", line 66, in render_animation
parseq_adapter = ParseqAdapter(parseq_args, anim_args, video_args, controlnet_args)
File "D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers\parseq_adapter.py", line 28, in __init__
self.cn_keys = ParseqControlNetKeysDecorator(self, ControlNetKeys(anim_args, controlnet_args)) if controlnet_args else None
File "D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers\animation_key_frames.py", line 66, in __init__
self.schedules[key] = self.fi.get_inbetweens(self.fi.parse_key_frames(getattr(controlnet_args, f"{prefix}_{suffix}")))
AttributeError: 'types.SimpleNamespace' object has no attribute 'cn_1_weight'
*END OF TRACEBACK*

User friendly error message:
Error: 'types.SimpleNamespace' object has no attribute 'cn_1_weight'. Check your schedules/ init values please. Also make sure you don't have a backwards slash in any of your PATHs - use / instead of \.
Deforum extension for auto1111 webui, v2.4b
Git commit: 858c4dd6

*START OF TRACEBACK*
Traceback (most recent call last):
File "D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers\run_deforum.py", line 78, in run_deforum
render_animation(args, anim_args, video_args, parseq_args, loop_args, controlnet_args, root)
File "D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers\render.py", line 66, in render_animation
parseq_adapter = ParseqAdapter(parseq_args, anim_args, video_args, controlnet_args)
File "D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers\parseq_adapter.py", line 28, in __init__
self.cn_keys = ParseqControlNetKeysDecorator(self, ControlNetKeys(anim_args, controlnet_args)) if controlnet_args else None
File "D:\A1111 Web UI Autoinstaller\stable-diffusion-webui\extensions\deforum-for-automatic1111-webui\scripts\deforum_helpers\animation_key_frames.py", line 66, in __init__
self.schedules[key] = self.fi.get_inbetweens(self.fi.parse_key_frames(getattr(controlnet_args, f"{prefix}_{suffix}")))
AttributeError: 'types.SimpleNamespace' object has no attribute 'cn_1_weight'
*END OF TRACEBACK*

User friendly error message:
Error: 'types.SimpleNamespace' object has no attribute 'cn_1_weight'. Check your schedules/ init values please. Also make sure you don't have a backwards slash in any of your PATHs - use / instead of \.
```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start in the Deforum tab of the stable webui, reproduce the failure by pressing Generate with the supplied settings, and capture the full console output. Trace the reported cn_1_weight access back to its initialization path; done means generation completes without the attribute error and the relevant settings still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.