XmYx / deforum-comfy-nodes

Deforum ComfyUI Nodes - ai animation node package
https://deforum.studio/
MIT License
158 stars 20 forks source link

Error Message: 'NoneType' object is not subscriptable #27

Closed camoody1 closed 5 months ago

camoody1 commented 7 months ago

I get this error message in the "(deforum) KSampler" node every time I attempt to run your sample workflows:

got prompt
[deforum] Frame: 0 of 120
model_type EPS
Using xformers attention in VAE
Using xformers attention in VAE
clip missing: ['clip_l.logit_scale', 'clip_l.transformer.text_projection.weight']
Requested to load SDXLClipModel
Loading 1 new model
[deforum] Blending next prompt:  anthropomorphic clean cat, surrounded by mandelbulb fractals, epic angle and pose, symmetrical, 3d, depth of field --neg nsfw, nude",, with alpha: 0.01798620996209156 ]
!!! Exception during processing !!!
Traceback (most recent call last):
  File "H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "H:\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-comfy-nodes\deforum_nodes\nodes\deforum_sampler_nodes.py", line 28, in sample
    latent["samples"] = latent["samples"].float()
                        ~~~~~~^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

Prompt executed in 12.41 seconds

Any idea how I can fix this issue?

xyzalanix commented 7 months ago

It's something to do with the init_latent on the iterator node. Works when i plug a latent image.

XmYx commented 7 months ago

Hey! So the logic there is, that the Deforum Iterator Node creates a new latent on frame 0 (when reset_latent = True), but on consequent frames, it just passes whatever latent input is connected to it. Therefore, as in the examples, a Deforum Cache Latent and a Deforum Load Cached Latent node takes care of the cycle, by you processing and encoding an image in each iteration, and caching it. On next run, the Load Cached Latent node will return that latent instead of None.

ultimatech-cn commented 6 months ago

In my comfyUI, the base sample workflow set like following

1713873437387

the error of

 File "..\custom_nodes\deforum-comfy-nodes\deforum_nodes\nodes\deforum_iteration_nodes.py", line 253, in get
    args.height, args.width = latent["samples"].shape[2] * 8, latent["samples"].shape[3] * 8
                              ~~~~~~^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

is gone. But I really didn't get it.

Zeelyne commented 6 months ago

In my comfyUI, the base sample workflow set like following 1713873437387

the error of

 File "..\custom_nodes\deforum-comfy-nodes\deforum_nodes\nodes\deforum_iteration_nodes.py", line 253, in get
    args.height, args.width = latent["samples"].shape[2] * 8, latent["samples"].shape[3] * 8
                              ~~~~~~^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

is gone. But I really didn't get it.

I tried this and i is working for me. Bravo!! Thanks!