From 2601a33e58fd49c63451f82db6a1c70b7b1f09fe Mon Sep 17 00:00:00 2001 From: billwuhao Date: Fri, 30 May 2025 20:12:48 +0800 Subject: [PATCH] fix model switching bug --- DiffRhythmNode.py | 4 +++- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/DiffRhythmNode.py b/DiffRhythmNode.py index b8f32fc..0f15bc7 100644 --- a/DiffRhythmNode.py +++ b/DiffRhythmNode.py @@ -169,6 +169,7 @@ class DiffRhythmRun: elif torch.backends.mps.is_available(): device = "mps" self.device = device + self.model_name = None @classmethod def INPUT_TYPES(cls): @@ -224,7 +225,8 @@ class DiffRhythmRun: max_frames = 6144 global CFM, TOKENIZER, MUQ, VAE, EVAL_MODEL, EVAL_MUQ - if CFM is None: + if CFM is None or self.model_name != model: + self.model_name = model CFM, TOKENIZER, MUQ, VAE, EVAL_MODEL, EVAL_MUQ = prepare_model(max_frames, self.device, model) batch_infer_num = 1 if quality_or_speed == "speed" else 5 diff --git a/pyproject.toml b/pyproject.toml index 609b43e..706de3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "diffrhythm_mw" description = "Blazingly Fast and Embarrassingly Simple End-to-End Full-Length Song Generation. A node for ComfyUI." -version = "2.2.3" +version = "2.2.4" license = {file = "LICENSE"} dependencies = ["# accelerate==1.4.0", "# torchdiffeq==0.2.5", "# torchaudio==2.6.0", "# transformers==4.49.0", "# librosa==0.10.2.post1", "# pyarrow==19.0.1", "# pandas==2.2.3", "# bitsandbytes", "# jieba==0.42.1", "# cn2an==0.5.23", "# pypinyin==0.53.0", "# onnxruntime", "LangSegment", "x-transformers", "pylance", "ema-pytorch", "prefigure", "muq", "mutagen", "pyopenjtalk", "pykakasi", "Unidecode", "phonemizer"]