kijai / ComfyUI-PyramidFlowWrapper

MIT License
97 stars 4 forks source link

ValueError:nan in latents #12

Open tdrminglin opened 13 hours ago

tdrminglin commented 13 hours ago

My gpu is 2080ti22G, comfyui says the cuda does not support bf16, I have to set model_dtype as fp16, Then I keep getting "nan in lantents" error. the whole log is as follows:

2024-10-12 00:05:30,985 - root - INFO - got prompt 2024-10-12 00:05:35,676 - root - ERROR - !!! Exception during processing !!! nan in latents 2024-10-12 00:05:35,676 - root - ERROR - Traceback (most recent call last): File "I:\stable_diffusion\ComfyUI-aki-v1.2\ComfyUI-aki-v1.2\execution.py", line 317, in execute output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "I:\stable_diffusion\ComfyUI-aki-v1.2\ComfyUI-aki-v1.2\execution.py", line 192, in get_output_data return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "I:\stable_diffusion\ComfyUI-aki-v1.2\ComfyUI-aki-v1.2\execution.py", line 169, in _map_node_over_list process_inputs(input_dict, i) File "I:\stable_diffusion\ComfyUI-aki-v1.2\ComfyUI-aki-v1.2\execution.py", line 158, in process_inputs results.append(getattr(obj, func)(inputs)) File "I:\stable_diffusion\ComfyUI-aki-v1.2\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-PyramidFlowWrapper\nodes.py", line 205, in sample latents = model["model"].generate( File "I:\stable_diffusion\ComfyUI-aki-v1.2\ComfyUI-aki-v1.2\python\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context return func(*args, *kwargs) File "I:\stable_diffusion\ComfyUI-aki-v1.2\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-PyramidFlowWrapper\pyramid_dit\pyramid_dit_for_video_gen_pipeline.py", line 578, in generate intermed_latents = self.generate_one_unit( File "I:\stable_diffusion\ComfyUI-aki-v1.2\ComfyUI-aki-v1.2\python\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context return func(args, kwargs) File "I:\stable_diffusion\ComfyUI-aki-v1.2\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-PyramidFlowWrapper\pyramid_dit\pyramid_dit_for_video_gen_pipeline.py", line 285, in generate_one_unit raise ValueError("nan in latents") ValueError: nan in latents

2024-10-12 00:05:35,677 - root - INFO - Prompt executed in 4.63 seconds

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

{"last_node_id":27,"last_link_id":38,"nodes":[{"id":8,"type":"PyramidFlowVAEDecode","pos":{"0":1161,"1":873},"size":{"0":315,"1":102},"flags":{},"order":3,"mode":0,"inputs":[{"name":"model","type":"PYRAMIDFLOWMODEL","link":8,"label":"model"},{"name":"samples","type":"LATENT","link":9,"label":"samples"}],"outputs":[{"name":"images","type":"IMAGE","links":[38],"slot_index":0,"label":"images"}],"properties":{"Node name for S&R":"PyramidFlowVAEDecode"},"widgets_values":[256,2]},{"id":9,"type":"PyramidFlowSampler","pos":{"0":1059,"1":497},"size":{"0":411.5168151855469,"1":314},"flags":{},"order":2,"mode":0,"inputs":[{"name":"model","type":"PYRAMIDFLOWMODEL","link":7,"label":"model"},{"name":"prompt_embeds","type":"PYRAMIDFLOWPROMPT","link":31,"label":"prompt_embeds"},{"name":"input_latent","type":"LATENT","link":null,"shape":7,"label":"input_latent"}],"outputs":[{"name":"model","type":"PYRAMIDFLOWMODEL","links":[8],"label":"model"},{"name":"samples","type":"LATENT","links":[9],"slot_index":1,"label":"samples"}],"properties":{"Node name for S&R":"PyramidFlowSampler"},"widgets_values":[1280,768,"20, 20, 20","10, 10, 10",16,7,5,44664248661394,"fixed",""]},{"id":14,"type":"VHS_VideoCombine","pos":{"0":1534,"1":490},"size":[1698.6201171875,310],"flags":{},"order":4,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":38,"label":"images"},{"name":"audio","type":"AUDIO","link":null,"shape":7,"label":"audio"},{"name":"meta_batch","type":"VHS_BatchManager","link":null,"shape":7,"label":"meta_batch"},{"name":"vae","type":"VAE","link":null,"shape":7,"label":"vae"}],"outputs":[{"name":"Filenames","type":"VHS_FILENAMES","links":null,"label":"Filenames"}],"properties":{"Node name for S&R":"VHS_VideoCombine"},"widgets_values":{"frame_rate":16,"loop_count":0,"filename_prefix":"PyramidFlow","format":"video/h264-mp4","pix_fmt":"yuv420p","crf":19,"save_metadata":true,"pingpong":false,"save_output":true,"videopreview":{"hidden":false,"paused":false,"params":{"filename":"PyramidFlow_00022.mp4","subfolder":"","type":"output","format":"video/h264-mp4","frame_rate":16},"muted":false}}},{"id":22,"type":"PyramidFlowTextEncode","pos":{"0":567,"1":757},"size":{"0":434.50982666015625,"1":227.74803161621094},"flags":{},"order":1,"mode":0,"inputs":[{"name":"model","type":"PYRAMIDFLOWMODEL","link":30,"label":"model"}],"outputs":[{"name":"prompt_embeds","type":"PYRAMIDFLOWPROMPT","links":[31],"label":"prompt_embeds"}],"properties":{"Node name for S&R":"PyramidFlowTextEncode"},"widgets_values":["A campfire burning with flames and embers, gradually increasing in size and intensity before dying down towards the end, hyper quality, Ultra HD, 8K","bad video",false]},{"id":5,"type":"DownloadAndLoadPyramidFlowModel","pos":{"0":575,"1":513},"size":{"0":385.7839050292969,"1":202},"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"pyramidflow_model","type":"PYRAMIDFLOWMODEL","links":[7,30],"slot_index":0,"label":"pyramidflow_model"}],"properties":{"Node name for S&R":"DownloadAndLoadPyramidFlowModel"},"widgets_values":["rain1011/pyramid-flow-sd3","diffusion_transformer_768p","fp16","fp16","fp16",false,false]}],"links":[[7,5,0,9,0,"PYRAMIDFLOWMODEL"],[8,9,0,8,0,"PYRAMIDFLOWMODEL"],[9,9,1,8,1,"LATENT"],[30,5,0,22,0,"PYRAMIDFLOWMODEL"],[31,22,0,9,1,"PYRAMIDFLOWPROMPT"],[38,8,0,14,0,"IMAGE"]],"groups":[],"config":{},"extra":{"ds":{"scale":1.708874251124587,"offset":[-739.5461978505967,-454.1771000145869]}},"version":0.4}

kijai commented 13 hours ago

I'm aware of this and it was one of the big issues I had getting this running, it's a known issue in the main code tracked here:

https://github.com/jy0205/Pyramid-Flow/issues/25