shadowcz007 / comfyui-sound-lab

A node collection for sound design, supporting MusicGen and Stable Audio. Welcome to use and experience it.
100 stars 6 forks source link

flash_attn安装并未出错,但运行时显示其没有被安装。 #8

Open BoosterCore opened 4 months ago

BoosterCore commented 4 months ago

在官方的Portable版本中,整个插件安装失败。 然后在秋叶整合版中尝试,插件是装上了,但遇到如题所示问题。

got prompt
No module named 'flash_attn'
flash_attn not installed, disabling Flash Attention
!!! Exception during processing!!! No module named 'vector_quantize_pytorch'
Traceback (most recent call last):
  File "J:\ComfyUI-aki-v1.3\execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "J:\ComfyUI-aki-v1.3\execution.py", line 81, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "J:\ComfyUI-aki-v1.3\execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "J:\ComfyUI-aki-v1.3\custom_nodes\comfyui-sound-lab\nodes\StableAudioNode.py", line 269, in run
    self.initialized_model,self.sample_rate,self.sample_size=load_model(device)
  File "J:\ComfyUI-aki-v1.3\custom_nodes\comfyui-sound-lab\nodes\StableAudioNode.py", line 180, in load_model
    model = create_model_from_config(model_config)
  File "J:\ComfyUI-aki-v1.3\custom_nodes\comfyui-sound-lab\nodes\stable_audio_tools\models\factory.py", line 16, in create_model_from_config
    return create_diffusion_cond_from_config(model_config)
  File "J:\ComfyUI-aki-v1.3\custom_nodes\comfyui-sound-lab\nodes\stable_audio_tools\models\diffusion.py", line 662, in create_diffusion_cond_from_config
    pretransform = create_pretransform_from_config(pretransform, sample_rate)
  File "J:\ComfyUI-aki-v1.3\custom_nodes\comfyui-sound-lab\nodes\stable_audio_tools\models\factory.py", line 38, in create_pretransform_from_config
    from .autoencoders import create_autoencoder_from_config
  File "J:\ComfyUI-aki-v1.3\custom_nodes\comfyui-sound-lab\nodes\stable_audio_tools\models\autoencoders.py", line 15, in <module>
    from .bottleneck import Bottleneck, DiscreteBottleneck
  File "J:\ComfyUI-aki-v1.3\custom_nodes\comfyui-sound-lab\nodes\stable_audio_tools\models\bottleneck.py", line 6, in <module>
    from vector_quantize_pytorch import ResidualVQ, FSQ
ModuleNotFoundError: No module named 'vector_quantize_pytorch'

Prompt executed in 10.97 seconds
changhefirst commented 4 months ago

因为作者并没有使用秋叶整合包。在install.bat这个安装脚本中,作者检测了是不是使用comfyui的win protable整合包,如果不是它的那个目录结构,就会默认使用系统的python环境来安装。而秋叶整合包默认使用了SD-Launcher这个python虚拟环境,所以虽然显示安装成功,但实际上秋叶的环境看不到。所以,把install.bat删成这样:

`@echo off

set "requirements_txt=%~dp0\requirements.txt" set "python_exec=python"

echo Installing ComfyUI's Sound lab Nodes..

REM 调用 python_exec 并获取版本信息 for /f "tokens=*" %%i in ('%python_exec% --version') do set PYTHON_VERSION=%%i

REM 显示 Python 版本 echo %PYTHON_VERSION%

%python_exec% -c "import torch; print(torch.version)"

echo Installing with ComfyUI Portable

@REM %python_exec% -s -m pip install --upgrade --force setuptools==69.5.1

%python_exec% -s -m pip install --upgrade --force ./ffmpy-0.3.2
%python_exec% -s -m pip install --upgrade protobuf==4.25.3

for /f "delims=" %%i in (%requirements_txt%) do (
    %python_exec% -s -m pip install "%%i" -i https://pypi.tuna.tsinghua.edu.cn/simple
)

pause`

就安到秋叶整合包里了。

ps,如果不用audiotools等工具的话, 根据之前issue的回复,将protobuf==4.25.3,不然还是启动会报错。

BoosterCore commented 4 months ago

感谢如此详尽的解答