MrForExample / ComfyUI-3D-Pack

An extensive node suite that enables ComfyUI to process 3D inputs (Mesh & UV Texture, etc) using cutting edge algorithms (3DGS, NeRF, etc.)
MIT License
2.13k stars 207 forks source link

StableFast3D via StabilityMatrix #252

Open hakbodi opened 1 month ago

hakbodi commented 1 month ago

So I've installed Comfy-3D-Pack in various ways now, once by downloading the comfyui portable folder, installing the correct torch, vision and audio version, fixing the bug with the VS2022 version etc. and got it all running. However doing it this way messed up all my other comfyui installs so I wanted to do it again via Stability Matrix (which sets up venv automatically etc.) The install went smooth, no errors on startup etc. however when I run a workflow and the SF3D model gets loaded I get the following error:

Error occurred when executing [Comfy3D] Load SF3D Model:

[WinError 2] The system cannot find the file specified: 'E:\\Stable'

  File "E:\Stable Diffusion\Packages\3D-Pack\execution.py", line 152, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "E:\Stable Diffusion\Packages\3D-Pack\execution.py", line 82, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "E:\Stable Diffusion\Packages\3D-Pack\execution.py", line 75, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "E:\Stable Diffusion\Packages\3D-Pack\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 1969, in load_SF3D
    sf3d_model = SF3D.from_pretrained(
  File "E:\Stable Diffusion\Packages\3D-Pack\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\StableFast3D\sf3d\system.py", line 78, in from_pretrained
    model = cls(cfg)
  File "E:\Stable Diffusion\Packages\3D-Pack\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\StableFast3D\sf3d\models\utils.py", line 29, in __init__
    self.configure(*args, **kwargs)
  File "E:\Stable Diffusion\Packages\3D-Pack\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\StableFast3D\sf3d\system.py", line 128, in configure
    self.baker = TextureBaker()
  File "E:\Stable Diffusion\Packages\3D-Pack\custom_nodes\ComfyUI-3D-Pack\Gen_3D_Modules\StableFast3D\sf3d\texture_baker.py", line 13, in __init__
    self.baker = slangtorch.loadModule(
  File "E:\Stable Diffusion\Packages\3D-Pack\venv\lib\site-packages\slangtorch\slangtorch.py", line 652, in loadModule
    rawModule = _loadModule(fileName, moduleName, buildDir, options, sourceDir=outputFolder, verbose=verbose, includePaths=includePaths, dryRun=False)
  File "E:\Stable Diffusion\Packages\3D-Pack\venv\lib\site-packages\slangtorch\slangtorch.py", line 557, in _loadModule
    resultCpp, metadataCpp = compileSlang(metadata.get("cpp", None), fileName, "torch-binding", options, cppOutName, verbose, includePaths=includePaths, dryRun=dryRun)
  File "E:\Stable Diffusion\Packages\3D-Pack\venv\lib\site-packages\slangtorch\slangtorch.py", line 313, in compileSlang
    return True, (_compileSlang(metadata, fileName, targetMode, options, outputFile, includePaths, verbose) if not dryRun else None)
  File "E:\Stable Diffusion\Packages\3D-Pack\venv\lib\site-packages\slangtorch\slangtorch.py", line 344, in _compileSlang
    deps = parseDepfile(depFile)
  File "E:\Stable Diffusion\Packages\3D-Pack\venv\lib\site-packages\slangtorch\slangtorch.py", line 526, in parseDepfile
    depFilesWithTimestamps = [
  File "E:\Stable Diffusion\Packages\3D-Pack\venv\lib\site-packages\slangtorch\slangtorch.py", line 527, in 
    (depFile, os.path.getmtime(depFile)) for depFile in depFiles]
  File "genericpath.py", line 55, in getmtime

I can't figure out why it's doing this. When I select the model file in the node it finds the file just fine and shows it in the list, but when I queue it throws this error. It should look for the model under "E:\Stable Diffusion\Packages\3D-Pack\custom_nodes\ComfyUI-3D-Pack\Checkpoints\StableFast3D" but it tries to find it in "E:\Stable"... why is it doing this?

Does anyone know why and how to fix it? Cheers!

Duodecimus commented 1 month ago

This is a bug in StableFast3D actually. If you track it down, you'll eventually find that the root cause is a function that builds directories to find models in.

the parser is bugged and any spaces in the file path will be interpreted as a new path, thus why it is searching in 'E:\Stable', as your path has 'E:\Stable Diffusion\'

hakbodi commented 1 month ago

This is a bug in StableFast3D actually. If you track it down, you'll eventually find that the root cause is a function that builds directories to find models in.

the parser is bugged and any spaces in the file path will be interpreted as a new path, thus why it is searching in 'E:\Stable', as your path has 'E:\Stable Diffusion'

I see, yes that makes sense, is there any way to fix this right now or do I need to wait for a StableFast3D fix?

EDIT: The solution should have been obvious to me. I re-installed ComfyUI into a folder without empty spaces in the name, everything works fine now.

Cignor commented 1 month ago

How did you fix the visual studio 2022 bug please?