TypeError: unsupported operand type(s) for //: 'int' and 'NoneType'

#8
by Caldoren - opened

File "/home/caldoren/anaconda3/envs/comfyui_env/lib/python3.10/site-packages/transformers/models/llava/processing_llava.py", line 160, in call
num_image_tokens = (height // self.patch_size) * (
TypeError: unsupported operand type(s) for //: 'int' and 'NoneType'

2025-01-28T17:38:05.776174 - Prompt executed in 121.69 seconds

## Attached Workflow
Please make sure that workflow does not contain any sensitive information such as API keys or passwords.

{"last_node_id":75,"last_link_id":83,"nodes":[{"id":65,"type":"LoadImage","pos":[-540,530],"size":[315,314],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[81],"slot_index":0},{"name":"MASK","type":"MASK","links":null}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["example.png","image"]},{"id":5,"type":"HyVideoDecode","pos":[690,-230],"size":[345.4285888671875,150],"flags":{},"order":6,"mode":0,"inputs":[{"name":"vae","type":"VAE","link":6},{"name":"samples","type":"LATENT","link":4}],"outputs":[{"name":"images","type":"IMAGE","links":[42],"slot_index":0}],"properties":{"Node name for S&R":"HyVideoDecode"},"widgets_values":[true,64,128,false]},{"id":34,"type":"VHS_VideoCombine","pos":[660,30],"size":[580.7774658203125,334],"flags":{},"order":7,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":42},{"name":"audio","type":"AUDIO","link":null,"shape":7},{"name":"meta_batch","type":"VHS_BatchManager","link":null,"shape":7},{"name":"vae","type":"VAE","link":null,"shape":7}],"outputs":[{"name":"Filenames","type":"VHS_FILENAMES","links":null}],"properties":{"Node name for S&R":"VHS_VideoCombine"},"widgets_values":{"frame_rate":12,"loop_count":0,"filename_prefix":"HunyuanVideo","format":"video/h264-mp4","pix_fmt":"yuv420p","crf":20,"save_metadata":true,"trim_to_audio":false,"pingpong":false,"save_output":true,"videopreview":{"hidden":false,"paused":false,"params":{"filename":"HunyuanVideo_00204.mp4","subfolder":"","type":"output","format":"video/h264-mp4","frame_rate":24},"muted":false}}},{"id":3,"type":"HyVideoSampler","pos":[260,-230],"size":[315,546],"flags":{},"order":5,"mode":0,"inputs":[{"name":"model","type":"HYVIDEOMODEL","link":2},{"name":"hyvid_embeds","type":"HYVIDEMBEDS","link":82},{"name":"samples","type":"LATENT","link":null,"shape":7},{"name":"stg_args","type":"STGARGS","link":null,"shape":7},{"name":"context_options","type":"HYVIDCONTEXT","link":null,"shape":7},{"name":"feta_args","type":"FETAARGS","link":null,"shape":7},{"name":"teacache_args","type":"TEACACHEARGS","link":null,"shape":7}],"outputs":[{"name":"samples","type":"LATENT","links":[4],"slot_index":0}],"properties":{"Node name for S&R":"HyVideoSampler"},"widgets_values":[208,208,49,30,7.5,7.5,233,"fixed",true,1,"FlowMatchDiscreteScheduler"]},{"id":71,"type":"DownloadAndLoadHyVideoTextEncoder","pos":[-637.5891723632812,201.5082244873047],"size":[441,178],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"hyvid_text_encoder","type":"HYVIDTEXTENCODER","links":[80],"slot_index":0}],"properties":{"Node name for S&R":"DownloadAndLoadHyVideoTextEncoder"},"widgets_values":["xtuner/llava-llama-3-8b-v1_1-transformers","openai/clip-vit-large-patch14","bf16",false,2,"disabled"]},{"id":1,"type":"HyVideoModelLoader","pos":[-285,-94],"size":[426.1773986816406,242],"flags":{},"order":2,"mode":0,"inputs":[{"name":"compile_args","type":"COMPILEARGS","link":null,"shape":7},{"name":"block_swap_args","type":"BLOCKSWAPARGS","link":null,"shape":7},{"name":"lora","type":"HYVIDLORA","link":null,"shape":7}],"outputs":[{"name":"model","type":"HYVIDEOMODEL","links":[2],"slot_index":0}],"properties":{"Node name for S&R":"HyVideoModelLoader"},"widgets_values":["hunyuan_video_FastVideo_720_fp8_e4m3fn.safetensors","bf16","fp8_e4m3fn","offload_device","sdpa",false,true]},{"id":7,"type":"HyVideoVAELoader","pos":[-277,-284],"size":[379.166748046875,82],"flags":{},"order":3,"mode":0,"inputs":[{"name":"compile_args","type":"COMPILEARGS","link":null,"shape":7}],"outputs":[{"name":"vae","type":"VAE","links":[6],"slot_index":0}],"properties":{"Node name for S&R":"HyVideoVAELoader"},"widgets_values":["hunyuan_video_vae_bf16.safetensors","bf16"]},{"id":73,"type":"HyVideoTextImageEncode","pos":[-38.233642578125,414.9195556640625],"size":[493.3573303222656,382.35430908203125],"flags":{},"order":4,"mode":0,"inputs":[{"name":"text_encoders","type":"HYVIDTEXTENCODER","link":80},{"name":"custom_prompt_template","type":"PROMPT_TEMPLATE","link":null,"shape":7},{"name":"clip_l","type":"CLIP","link":null,"shape":7},{"name":"image1","type":"IMAGE","link":81,"shape":7},{"name":"image2","type":"IMAGE","link":null,"shape":7},{"name":"hyvid_cfg","type":"HYVID_CFG","link":null,"shape":7}],"outputs":[{"name":"hyvid_embeds","type":"HYVIDEMBEDS","links":[82],"slot_index":0}],"properties":{"Node name for S&R":"HyVideoTextImageEncode"},"widgets_values":["Astonishing promotion video of a toy movie, high quality video 4k A fluffy plushie stuffed animal of , furry fox ears, dancing on grass land with blue sky. cinematic realistic rendering","::3",true,"video",""]}],"links":[[2,1,0,3,0,"HYVIDEOMODEL"],[4,3,0,5,1,"LATENT"],[6,7,0,5,0,"VAE"],[42,5,0,34,0,"IMAGE"],[80,71,0,73,0,"HYVIDTEXTENCODER"],[81,65,0,73,3,"IMAGE"],[82,73,0,3,1,"HYVIDEMBEDS"]],"groups":[],"config":{},"extra":{"ds":{"scale":1,"offset":[698.7945096958763,167.68446140399163]},"workspace_info":{"id":"kZ4q7BpZY-s3NIJ0k8OPz"},"node_versions":{"comfy-core":"0.3.12","comfyui-hunyuanvideowrapper":"1.0.1","comfyui-videohelpersuite":"1.4.6"},"VHS_latentpreview":false,"VHS_latentpreviewrate":0},"version":0.4}


## Additional Context
(Please add any additional context or steps to reproduce the error here)

Hello, can someone please address this? I have the same problem trying their own examples that come with the package:

HyVideoTextImageEncode
unsupported operand type(s) for //: 'int' and 'NoneType'

try it:
pip install transformers==4.47.0

pip install transformers==4.47.0 worked thanks

I don't think that command line is working for me in portable comfy ui, because it's saying it successfuly uninstalled 4.48.3 and then successfuly installed transformers -4 .48.3 in the next line. Am I reading this accurately?

Attempting uninstall: transformers
Found existing installation: transformers 4.48.3
Uninstalling transformers-4.48.3:
Successfully uninstalled transformers-4.48.3
WARNING: The script transformers-cli.exe is installed in 'Z:\ComfyUI_windows_portable\python_embeded\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed transformers-4.48.3

Since it's an env I think I'm correct in not wanting on PATH but it looks like it's just re-installing the offending version of python transformers rather than following the command to downgrade to 47.0. Any insight? Thanks.

Update: I'm likely misunderstanding what that last line meant because indeed that did fix the issue for me. Video successfully rendered without the error message!

I wish I had more to say about this, unfortunately I am more of an 'artist who breaks stuff' than someone who is methodically and logically approaching the problems here.

Since this issue came up, I have switched over to running a docker image instead of py venv's and I have seen way better 'interoperability' or whatever you might call it, between nodes, models, packages, and the comfyui manager.

Let me know if you are interested in knowing more.

Sign up or log in to comment