flowtyone / ComfyUI-Flowty-CRM

This is a custom node that lets you use Convolutional Reconstruction Models right from ComfyUI.
Other
128 stars 7 forks source link

FileNotFoundError: [Errno 2] No such file or directory: '...\\temp\\tmp.mtl' #38

Open StephZarx opened 1 week ago

StephZarx commented 1 week ago

Hello,

After CRM Modeler node, I have the following message :

[INFO] mesh cleaning: (4134, 3) --> (4131, 3), (8264, 3) --> (8258, 3) !!! Exception during processing!!! [Errno 2] No such file or directory: 'D:\AI\ComfyUI\temp\tmp.mtl' Traceback (most recent call last): File "D:\AI\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI\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 "D:\AI\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI\ComfyUI\custom_nodes\ComfyUI-Flowty-CRM__init__.py", line 327, in make_model mesh = generate3d_cuda(crm_model, rgb, ccm, device) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AI\ComfyUI\custom_nodes\ComfyUI-Flowty-CRM\crmlib\inference.py", line 135, in generate3d_cuda model.export_mesh_wt_uv(glctx, data_config, mesh_path_obj, "", device, res=(1024,1024), tri_fea_2=triplane_feature2) File "D:\AI\ComfyUI\custom_nodes\ComfyUI-Flowty-CRM\crmlib\model\crm\model.py", line 169, in export_mesh_wt_uv fid = open(matname, 'w') ^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'D:\AI\ComfyUI\temp\tmp.mtl'

Your help would be appreciated to solve this final step.

Thank you.

Zhujzs commented 1 week ago

I had encountered the same situation just a few minutes ago. However, when I tried using Python 3.9.13 instead of Python 3.12, the preview pictures were rotated and it worked.

Like this:

got prompt Loading CRM model C:\Users\Orang\Documents\GitHub\ComfyUI\env\lib\site-packages\torch\utils\cpp_extension.py:1965: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation. If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST']. warnings.warn( C:\Users\Orang\Documents\GitHub\ComfyUI\env\lib\site-packages\diffusers\models\attention_processor.py:1584: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:555.) hidden_states = F.scaled_dot_product_attention( unet takes 0.5519907474517822s [INFO] mesh cleaning: (23218, 3) --> (22628, 3), (46364, 3) --> (45275, 3) [load_obj] use texture from: C:\Users\Orang\Documents\GitHub\ComfyUI\temp\tmp.png [load_obj] load texture: (1024, 1024, 3) [Mesh loading] v: torch.Size([22628, 3]), f: torch.Size([45275, 3]) C:\Users\Orang\Documents\GitHub\ComfyUI\custom_nodes\ComfyUI-Flowty-CRM\crmlib\mesh.py:466: UserWarning: Using torch.cross without specifying the dim arg is deprecated. Please either pass the dim explicitly or simply use torch.linalg.cross. The default value of dim will change to agree with that of linalg.cross in a future release. (Triggered internally at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\Cross.cpp:66.) face_normals = torch.cross(v1 - v0, v2 - v0) [Mesh loading] vn: torch.Size([22628, 3]), fn: torch.Size([45275, 3]) Prompt executed in 15.18 seconds

Before this, I also encountered a situation similar to https://github.com/flowtyone/ComfyUI-Flowty-CRM/issues/34

I added CppProperties_schema.json to the ComfyUI folder in VS 2022 to resolve the issue.

CppProperties_schema.json

{ "configurations": [ { "inheritEnvironments": [ "msvc_x64" ], "name": "x64-Debug", "includePath": [ "${env.INCLUDE}", "${workspaceRoot}\**" ], "defines": [ "WIN64", "_DEBUG", "UNICODE", "_UNICODE" ], "intelliSenseMode": "windows-msvc-x64" } ] }

Also, I used VS 2022 to set up the environment and tried the methods below.

https://www.reddit.com/r/comfyui/comments/1bf7tv1/comment/l2uu0wy

https://www.reddit.com/r/comfyui/comments/1bf7tv1/comment/kv2nt8d

pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121

Reinstall Nvdiffrast and ComfyUI-Flowty-CRM (no need to reinstall the models) without using the mod manager.

StephZarx commented 1 week ago

I do not understand your information. On my side everything is OK with installation and compilation for nvdiffrast. The only thing which could be maybe understandable is the fact that it should be possible to install ComfyUI-Flowty-CRM with another "temp" directory because the one in place is not the right one. But I do not know how to do that with my configuration.

StephZarx commented 1 week ago

But I deleted "D:\AI\ComfyUI\custom_nodes\ComfyUI-Flowty-CRM". Then manually without Comfyui manager : "D:\AI\ComfyUI\custom_nodes\" > git clone https://github.com/flowtyone/ComfyUI-Flowty-CRM.git "D:\AI\ComfyUI\custom_nodes\ComfyUI-Flowty-CRM" > pip install -r requirements.txt "D:\AI\ComfyUI\custom_nodes\ComfyUI-Flowty-CRM" > pip install -r requirements-cuda.txt

And tadaaa ! This is strange but it works fine now. Thank you.