kabachuha / sd-webui-text2video

Auto1111 extension implementing text2video diffusion models (like ModelScope or VideoCrafter) using only Auto1111 webui dependencies
Other
1.28k stars 106 forks source link

Fix[122] :: Exception occurred: 'NoneType' object has no attribute 'name' #127

Closed rbfussell closed 1 year ago

rbfussell commented 1 year ago

Per: https://github.com/deforum-art/sd-webui-text2video/issues/122

process_modelscope.py:: inpainting_frames->args.inpainting_frames && hasattr(args.inpainting_image, "name") Fixed two issues that saw similar presentation:

1: inpainting_frames did not have args. prepended, necessary after the move of this function from text2vid.py.
2: added a check for attribute name in args.inpainting_image, This resolves the issue of having frames nonzero in the img2text section without an image loaded resulting in the attribute not existing for args.inpainting_image.name

This should fix those two issues.

kabachuha commented 1 year ago

How about raising an exception instead, so it would prevent the users from wasting their time and resources?

rbfussell commented 1 year ago

How about raising an exception instead, so it would prevent the users from wasting their time and resources? It simply does not work. With this, it simply runs as iff there is no frame count set and no image in place. It does not fail, it works as expected. The behavior as it currently is , fails when it is set as such :

image

As it is currently, this simply does nothing, it produces no video, it simply fails with the exception thrown to the console / log. With the reported ambiguous exception. With this patch, it will run, not wasting resources, but as if you had it set to 0.

Case:

0/no image 0 / image >0/no image

all execute the same with this patch. Without it >0/no image fails to run the video generation exiting with this exception.

I don't think any resources and time are wasted with this, it simply rectifies the ambiguous exit on exception. We see it already checking to ensure inpaint frames>0 , this simply doubles down and ensures that both inpaint frames>0 and img2text source image are present.

rbfussell commented 1 year ago

I wish I had seen this before pulling this, though this addresses the two errors in #122 in process_modelscope.py , I failed to notice the third, which is in clip_hardcode.py::96~ So I submitted another @ #129 to facilitate closing of #122