Code Monkey home page Code Monkey logo

Comments (4)

yingtao-xie avatar yingtao-xie commented on May 28, 2024 2

image

this is the structure, as same as you, it is 4.17 gb.

class AudioLDM2ModelPredictor:
    
    def __init__(self):
        from diffusers import AudioLDM2Pipeline
        self.device = "cuda" if torch.cuda.is_available() else "cpu"
        torch_dtype = torch.float16 if self.device == "cuda" else torch.float32

        # Use snapshot_download to manage the model download/cache
        self.model_path = snapshot_download("cvssp/audioldm2",
                                            local_dir=files_for_audio_model,
                                            force_download=False,  # Set to True to always download
                                            local_files_only=False,  # Download if not available locally
                                            use_auth_token=False,  # Set to True if using a private model
                                            local_dir_use_symlinks="auto",  # Auto-manage symlinks
                                            ignore_patterns=["*.bin", "*.jpg", "*.png"])  # Ignore unrelated files

        self.pipeline = AudioLDM2Pipeline.from_pretrained(self.model_path, 
                                                          torch_dtype=torch_dtype).to(self.device)
        self.generator = torch.Generator(self.device)

change above code with this inside custom_nodes/ComfyUI_VLM_nodes/nodes/audioldm2.py

class AudioLDM2ModelPredictor:
   
   def __init__(self):
       from diffusers import AudioLDM2Pipeline
       self.device = "cuda" if torch.cuda.is_available() else "cpu"
       torch_dtype = torch.float16 if self.device == "cuda" else torch.float32

       # Use snapshot_download to manage the model download/cache
       self.model_path = files_for_audio_model

       self.pipeline = AudioLDM2Pipeline.from_pretrained(self.model_path, 
                                                         torch_dtype=torch_dtype).to(self.device)
       self.generator = torch.Generator(self.device)

Thank you very much for the author's guidance, according to your setting is successful! One reason for the installation failure is the local path setting, and another reason is that the downloaded configuration file name is not the same as his program, such as the language model folder in the configuration file is config.json, and the download from huggingface is language_model_config.json

from comfyui_vlm_nodes.

gokayfem avatar gokayfem commented on May 28, 2024

if you are sure about you download the all of the files. change local_files_only=True in the audiolmd2.py inside ComfyUI_VLM_nodes/nodes folder

from comfyui_vlm_nodes.

yingtao-xie avatar yingtao-xie commented on May 28, 2024

if you are sure about you download the all of the files. change local_files_only=True in the audiolmd2.py inside ComfyUI_VLM_nodes/nodes folder

Yes, I downloaded all files related to audioldm2, but I still can't run this node. The file structure on hugging face is maintained in the folder "files_for_audioldm2". Can u share the structures and content of this folder, plz?

ps, even though I rewrote the option of "local_files_only", it didn't work.

The error:
Cannot find an appropriate cached snapshot folder for the specified revision on the local disk and outgoing traffic has been disabled. To enable repo look-ups and downloads online, pass 'local_files_only=False' as input.

from comfyui_vlm_nodes.

gokayfem avatar gokayfem commented on May 28, 2024

image

this is the structure, as same as you, it is 4.17 gb.

class AudioLDM2ModelPredictor:
    
    def __init__(self):
        from diffusers import AudioLDM2Pipeline
        self.device = "cuda" if torch.cuda.is_available() else "cpu"
        torch_dtype = torch.float16 if self.device == "cuda" else torch.float32

        # Use snapshot_download to manage the model download/cache
        self.model_path = snapshot_download("cvssp/audioldm2",
                                            local_dir=files_for_audio_model,
                                            force_download=False,  # Set to True to always download
                                            local_files_only=False,  # Download if not available locally
                                            use_auth_token=False,  # Set to True if using a private model
                                            local_dir_use_symlinks="auto",  # Auto-manage symlinks
                                            ignore_patterns=["*.bin", "*.jpg", "*.png"])  # Ignore unrelated files

        self.pipeline = AudioLDM2Pipeline.from_pretrained(self.model_path, 
                                                          torch_dtype=torch_dtype).to(self.device)
        self.generator = torch.Generator(self.device)

change above code with this inside custom_nodes/ComfyUI_VLM_nodes/nodes/audioldm2.py

class AudioLDM2ModelPredictor:
   
   def __init__(self):
       from diffusers import AudioLDM2Pipeline
       self.device = "cuda" if torch.cuda.is_available() else "cpu"
       torch_dtype = torch.float16 if self.device == "cuda" else torch.float32

       # Use snapshot_download to manage the model download/cache
       self.model_path = files_for_audio_model

       self.pipeline = AudioLDM2Pipeline.from_pretrained(self.model_path, 
                                                         torch_dtype=torch_dtype).to(self.device)
       self.generator = torch.Generator(self.device)

from comfyui_vlm_nodes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.