Python
added heartluma 230126 checkpoint support
DeepBeepMeep3fc5da954d38
diff --git a/README.md b/README.mdindex 94341c6..bcd25c2 100644--- a/README.md+++ b/README.md@@ -26,7 +26,7 @@ WanGP supports the Wan (and derived models), Hunyuan Video, Flux, Qwen, Z-Image,## 🔥 Latest Updates :-### January 23th 2026: WanGP v10.50, Music for your Hearts+### January 24th 2026: WanGP v10.51, Music for your HeartsWanGP Special *TTS* (Text To Speech) Release:@@ -40,6 +40,7 @@ WanGP Special *TTS* (Text To Speech) Release:- **Custom Output folder for Audio Gens**: you can now choose a different folder for the *Audio Outputs*- **Default Memory Profile for Audio Models**: TTS models can get very slow if you use profile 4 (being autoregressive models, they will need to load all the layers one per one to generate one single audio token then rinse & repeat). On the other hand, they dont't need as much VRAM, so you can now define a more agressive profile (3+ for instance)+*update 10.51*: new Heart Mula Finetune better at following instructions, Extra settings (cfg, top k) for TTS models, Rife v4### January 20th 2026: WanGP v10.43, The Cost Saver*GPUs are expensive, RAM is expensive, SSD are expensive, sadly we live now in a GPU & RAM poor.*diff --git a/defaults/heartmula_rl_oss_3b_20260123.json b/defaults/heartmula_rl_oss_3b_20260123.jsonnew file mode 100644index 0000000..45cc9cd--- /dev/null+++ b/defaults/heartmula_rl_oss_3b_20260123.json@@ -0,0 +1,15 @@+{+ "model": {+ "name": "TTS HeartMuLa RL OSS (20260123) 3B",+ "architecture": "heartmula_oss_3b",+ "description": "HeartMuLa RL OSS 3B checkpoint (20260123) with updated codec support. This version should be better at following instructions thanks to a reinforced learning training.",+ "URLs": [+ "https://huggingface.co/DeepBeepMeep/HeartMuLa/resolve/main/heartmula_rl_oss_3b_20260123_bf16.safetensors",+ "https://huggingface.co/DeepBeepMeep/HeartMuLa/resolve/main/heartmula_rl_oss_3b_20260123_quanto_bf16_int8.safetensors"+ ],+ "heartmula_codec_version": "20260123"+ },+ "prompt": "[Verse]\nMorning light through the window pane\nI hum a tune to chase the rain\nSteady steps on a quiet street\nHeart and rhythm, gentle beat",+ "alt_prompt": "piano,happy,wedding",+ "temperature": 1.0+}diff --git a/models/TTS/HeartMula/pipeline.py b/models/TTS/HeartMula/pipeline.pyindex 4006c92..8ca8523 100644--- a/models/TTS/HeartMula/pipeline.py+++ b/models/TTS/HeartMula/pipeline.py@@ -40,6 +40,14 @@ def _resolve_paths()+def _resolve_codec_names(codec_version: Optional[str]) -> tuple[str, str]:+ if codec_version:+ suffix = f"_{codec_version}"+ else:+ suffix = ""+ return f"HeartMula_codec{suffix}.safetensors", f"codec_config{suffix}.json"++@dataclassclass HeartMuLaGenConfig:text_bos_id: int = 128000@@ -79,6 +87,7 @@ class HeartMuLaPipeline:max_audio_length_ms: int = 120000,codec_steps: int = 10,codec_guidance_scale: float = 1.25,+ codec_version: str = "",VAE_dtype = torch.float32,):self.device = torch.device("cpu")@@ -92,6 +101,7 @@ class HeartMuLaPipeline:self.max_audio_length_ms = max_audio_length_msself.codec_steps = codec_stepsself.codec_guidance_scale = codec_guidance_scale+ self.codec_version = codec_versionself.heartmula_weights_path = heartmula_weights_pathself.VAE_dtype = VAE_dtype@@ -146,25 +156,26 @@ class HeartMuLaPipeline:first_param = next(self.mula.parameters(), None)if first_param is not None:self.mula_dtype = first_param.dtype+ codec_weights_name, codec_config_name = _resolve_codec_names(self.codec_version)codec_weights_path = fl.locate_file(- os.path.join("HeartMula", "HeartMula_codec.safetensors"), error_if_none=False+ os.path.join("HeartMula", codec_weights_name), error_if_none=False)codec_weights_path = (Path(codec_weights_path)if codec_weights_path- else Path(codec_path) / "HeartMula_codec.safetensors"+ else Path(codec_path) / codec_weights_name)if not codec_weights_path.is_file():raise FileNotFoundError(f"Expected HeartCodec weights at {codec_weights_path} but not found.")codec_config_path = fl.locate_file(- os.path.join("HeartMula", "codec_config.json"), error_if_none=False+ os.path.join("HeartMula", codec_config_name), error_if_none=False)codec_config_path = (Path(codec_config_path)if codec_config_path- else Path(codec_path) / "codec_config.json"+ else Path(codec_path) / codec_config_name)if not codec_config_path.is_file():raise FileNotFoundError(@@ -470,7 +481,13 @@ class HeartMuLaPipeline:raise ValueError("Keywords prompt cannot be empty for HeartMuLa generation.")cfg_scale = float(kwargs.get("cfg_scale", self.cfg_scale))- topk = int(kwargs.get("topk", self.topk))+ topk_value = kwargs.get("topk", None)+ if topk_value is None:+ topk_value = kwargs.get("top_k", self.topk)+ try:+ topk = int(topk_value)+ except (TypeError, ValueError):+ topk = int(self.topk)duration_seconds = kwargs.get("duration_seconds", None)if duration_seconds is not None:try:diff --git a/models/TTS/chatterbox/pipeline.py b/models/TTS/chatterbox/pipeline.pyindex 77a7533..eaa9176 100644--- a/models/TTS/chatterbox/pipeline.py+++ b/models/TTS/chatterbox/pipeline.py@@ -65,6 +65,12 @@ class ChatterboxPipeline:language_id = model_modecfg_weight = pace+ cfg_override = bkwargs.get("cfg_scale", None)+ if cfg_override is not None:+ try:+ cfg_weight = float(cfg_override)+ except (TypeError, ValueError):+ passif language_id:language_id = language_id.lower()if language_id not in SUPPORTED_LANGUAGES:diff --git a/models/TTS/qwen3/defs.py b/models/TTS/qwen3/defs.pyindex ace8d7b..6f36459 100644--- a/models/TTS/qwen3/defs.py+++ b/models/TTS/qwen3/defs.py@@ -205,6 +205,7 @@ def get_qwen3_model_def(base_model_type: str) -> dict:"supports_early_stop": True,"profiles_dir": [base_model_type],"duration_slider": dict(QWEN3_TTS_DURATION_SLIDER),+ "top_k_slider": True,"text_prompt_enhancer_instructions": TTS_MONOLOGUE_PROMPT,"compile": False,}diff --git a/models/TTS/qwen3/pipeline.py b/models/TTS/qwen3/pipeline.pyindex e8e210c..2eac6ac 100644--- a/models/TTS/qwen3/pipeline.py+++ b/models/TTS/qwen3/pipeline.py@@ -312,6 +312,12 @@ class Qwen3TTSPipeline:"temperature": float(temperature),"stopping_criteria": stopping,}+ top_k = kwargs.get("top_k", None)+ if top_k is not None:+ try:+ gen_kwargs["top_k"] = int(top_k)+ except (TypeError, ValueError):+ passtry:if self.base_model_type == "qwen3_tts_customvoice":diff --git a/models/TTS/tts_handler.py b/models/TTS/tts_handler.pyindex 11b9143..d326ff7 100644--- a/models/TTS/tts_handler.py+++ b/models/TTS/tts_handler.py@@ -97,7 +97,7 @@ def _get_heartmula_model_def():"audio_only": True,"image_outputs": False,"sliding_window": False,- "guidance_max_phases": 0,+ "guidance_max_phases": 1,"no_negative_prompt": True,"image_prompt_types_allowed": "","supports_early_stop": True,@@ -128,11 +128,13 @@ def _get_heartmula_model_def():"increment": 0.1,"default": 120,},+ "top_k_slider": True,"heartmula_cfg_scale": 1.5,"heartmula_topk": 50,"heartmula_max_audio_length_ms": 120000,"heartmula_codec_guidance_scale": 1.25,"heartmula_codec_steps": 10,+ "heartmula_codec_version": "","compile": False, #["transformer", "transformer2"]}@@ -198,16 +200,19 @@ def _get_chatterbox_download_def():}-def _get_heartmula_download_def():+def _get_heartmula_download_def(model_def):+ codec_version = (model_def or {}).get("heartmula_codec_version", "")+ codec_suffix = f"_{codec_version}" if codec_version else ""+ repo_id = "DeepBeepMeep/HeartMuLa" if codec_version else "DeepBeepMeep/TTS"gen_files = ["gen_config.json","tokenizer.json",- "codec_config.json",- "HeartMula_codec.safetensors",+ f"codec_config{codec_suffix}.json",+ f"HeartMula_codec{codec_suffix}.safetensors",]return [{- "repoId": "DeepBeepMeep/TTS",+ "repoId": repo_id,"sourceFolderList": ["HeartMula"],"fileList": [gen_files],},@@ -324,7 +329,7 @@ class family_handler:@staticmethoddef query_model_files(computeList, base_model_type, model_def=None):if base_model_type == "heartmula_oss_3b":- return _get_heartmula_download_def()+ return _get_heartmula_download_def(model_def or {})if base_model_type == "yue":return _get_yue_download_def(model_def or {})if base_model_type in qwen3_defs.QWEN3_TTS_VARIANTS:@@ -378,6 +383,7 @@ class family_handler:codec_guidance_scale=model_def.get("heartmula_codec_guidance_scale", 1.25),+ codec_version=model_def.get("heartmula_codec_version", ""),)pipeline.mula.decoder[0].layers._compile_me = False@@ -499,6 +505,15 @@ class family_handler:}for key, value in defaults.items():ui_defaults.setdefault(key, value)+ if settings_version < 2.44:+ if base_model_type == "heartmula_oss_3b":+ ui_defaults["guidance_scale"] = model_def.get("heartmula_cfg_scale", 1.5)+ ui_defaults["top_k"] = model_def.get("heartmula_topk", 50)+ elif base_model_type in qwen3_defs.QWEN3_TTS_VARIANTS:+ if model_def.get("top_k_slider", False):+ ui_defaults["top_k"] = 50+ elif base_model_type != "yue":+ ui_defaults["guidance_scale"] = 1.0@staticmethoddef update_default_settings(base_model_type, model_def, ui_defaults):@@ -514,6 +529,8 @@ class family_handler:"num_inference_steps": 0,"negative_prompt": "","temperature": 1.0,+ "guidance_scale": model_def.get("heartmula_cfg_scale", 1.5),+ "top_k": model_def.get("heartmula_topk", 50),"multi_prompts_gen_type": 2})@@ -547,6 +564,7 @@ class family_handler:"num_inference_steps": 0,"negative_prompt": "","temperature": 0.9,+ "top_k": 50,"multi_prompts_gen_type": 2,})@@ -564,6 +582,7 @@ class family_handler:"num_inference_steps": 0,"negative_prompt": "","temperature": 0.9,+ "top_k": 50,"multi_prompts_gen_type": 2,})@@ -581,6 +600,7 @@ class family_handler:"num_inference_steps": 0,"negative_prompt": "","temperature": 0.9,+ "top_k": 50,"multi_prompts_gen_type": 2,})@@ -597,6 +617,7 @@ class family_handler:"exaggeration": 0.5,"temperature": 0.8,"pace": 0.5,+ "guidance_scale": 1.0,"multi_prompts_gen_type": 2,})diff --git a/models/_settings.json b/models/_settings.jsonindex 94a7d20..7798da8 100644--- a/models/_settings.json+++ b/models/_settings.json@@ -41,6 +41,7 @@"embedded_guidance_scale": 6.0,"alt_guidance_scale": 6.0,"temperature": 0.8,+ "top_k": 50,"sample_solver": "","flow_shift":3,"control_net_weight": 1,diff --git a/plugins/wan2gp-downloads/plugin.py b/plugins/wan2gp-downloads/plugin.pyindex a78f369..991dbbc 100644--- a/plugins/wan2gp-downloads/plugin.py+++ b/plugins/wan2gp-downloads/plugin.py@@ -10,9 +10,10 @@ from huggingface_hub import snapshot_downloadclass DownloadsPlugin(WAN2GPPlugin):def __init__(self):super().__init__()- self.name = "Downloads Tab"+ self.name = "Wan i2v Loras Packs"self.version = "1.0.0"- self.description = "Download our in-house loras!"+ self.description = "Auto Download i2v Loras with special effects"+ self.uninstallable = Falsedef setup_ui(self):self.request_global("get_lora_dir")diff --git a/plugins/wan2gp-models-manager/plugin.py b/plugins/wan2gp-models-manager/plugin.pyindex 0bc555b..38a59e3 100644--- a/plugins/wan2gp-models-manager/plugin.py+++ b/plugins/wan2gp-models-manager/plugin.py@@ -14,6 +14,7 @@ class modelsManagerPlugin(WAN2GPPlugin):self.name = "Models Manager"self.version = "1.0.0"self.description = "Inspect and manage installed model dependencies"+ self.uninstallable = Falseself._node_map = {}self._tree_data = []self._model_files = {}diff --git a/plugins/wan2gp-plugin-manager/plugin.py b/plugins/wan2gp-plugin-manager/plugin.pyindex ee10a6e..e34b51d 100644--- a/plugins/wan2gp-plugin-manager/plugin.py+++ b/plugins/wan2gp-plugin-manager/plugin.py@@ -221,6 +221,17 @@ class PluginManagerUIPlugin(WAN2GPPlugin):margin-left: 8px;white-space: nowrap;}+ .plugin-bundled-badge {+ font-size: 0.85em;+ font-weight: 600;+ color: var(--text-color-secondary);+ background-color: var(--background-fill-primary);+ padding: 2px 8px;+ border-radius: 4px;+ margin-left: 8px;+ border: 1px solid var(--border-color-primary);+ white-space: nowrap;+ }.plugin-item.update-available {border-left: 4px solid var(--color-accent);}@@ -241,6 +252,7 @@ class PluginManagerUIPlugin(WAN2GPPlugin):for plugin in user_plugins:plugin_id = plugin['id']checked = "checked" if plugin_id in enabled_user_plugins else ""+ uninstallable = plugin.get('uninstallable', True)update_notice_html = ''item_update_class = ''@@ -250,6 +262,19 @@ class PluginManagerUIPlugin(WAN2GPPlugin):if remote_version > local_version:update_notice_html = f'<span class="update-available-notice">v{remote_version} update available</span>'item_update_class = 'update-available'++ bundled_badge_html = ''+ if not uninstallable:+ bundled_badge_html = '<span class="plugin-bundled-badge" title="Bundled plugin, cannot be uninstalled">Bundled</span>'++ actions_html = ""+ if uninstallable:+ actions_html = """+ <button class="plugin-action-btn" onclick="handlePluginAction(this, 'update')">Update</button>+ <button class="plugin-action-btn" onclick="handlePluginAction(this, 'reinstall')">Reinstall</button>+ <button class="plugin-action-btn" onclick="handlePluginAction(this, 'uninstall')">Uninstall</button>+ """+ actions_container_html = f'<div class="plugin-item-actions">{actions_html}</div>' if actions_html else ""user_items_html += f"""<div class="plugin-item {item_update_class}" data-plugin-id="{plugin_id}" draggable="true">@@ -259,16 +284,13 @@ class PluginManagerUIPlugin(WAN2GPPlugin):<div class="plugin-header"><span class="name">{plugin['name']}</span>{update_notice_html}+ {bundled_badge_html}</div><span class="version">version {plugin['version']} (id: {plugin['id']})</span><span class="description">{plugin.get('description', 'No description provided.')}</span></div></div>- <div class="plugin-item-actions">- <button class="plugin-action-btn" onclick="handlePluginAction(this, 'update')">Update</button>- <button class="plugin-action-btn" onclick="handlePluginAction(this, 'reinstall')">Reinstall</button>- <button class="plugin-action-btn" onclick="handlePluginAction(this, 'uninstall')">Uninstall</button>- </div>+ {actions_container_html}</div>"""user_html = f'<div id="user-plugin-list">{user_items_html}</div>'@@ -445,4 +467,4 @@ class PluginManagerUIPlugin(WAN2GPPlugin):if hasattr(self, '_community_plugins_cache'):del self._community_plugins_cache- return self._build_plugins_html(), self._build_community_plugins_html()\ No newline at end of file+ return self._build_plugins_html(), self._build_community_plugins_html()diff --git a/plugins/wan2gp-sample/plugin.py b/plugins/wan2gp-sample/plugin.pyindex 63e2eca..c87af51 100644--- a/plugins/wan2gp-sample/plugin.py+++ b/plugins/wan2gp-sample/plugin.py@@ -20,7 +20,8 @@ class ConfigTabPlugin(WAN2GPPlugin):super().__init__()self.name = PlugIn_Nameself.version = "1.0.0"- self.description = PlugIn_Name+ self.description = "Sample Source Code to Design Plugins"+ self.uninstallable = Falsedef setup_ui(self):self.request_global("get_current_model_settings")@@ -91,4 +92,4 @@ class ConfigTabPlugin(WAN2GPPlugin):outputs=[ self.main_tabs ])-\ No newline at end of file+diff --git a/shared/utils/plugins.py b/shared/utils/plugins.pyindex 4d13eed..50247a3 100644--- a/shared/utils/plugins.py+++ b/shared/utils/plugins.py@@ -55,7 +55,6 @@ SYSTEM_PLUGINS = ["wan2gp-video-mask-creator","wan2gp-motion-designer","wan2gp-guides",- "wan2gp-downloads","wan2gp-configuration","wan2gp-plugin-manager","wan2gp-about",@@ -81,6 +80,7 @@ class WAN2GPPlugin:self.name = self.__class__.__name__self.version = "1.0.0"self.description = "No description provided."+ self.uninstallable = Trueself._component_requests: List[str] = []self._global_requests: List[str] = []self._insert_after_requests: List[InsertAfterRequest] = []@@ -164,7 +164,15 @@ class PluginManager:for dir_name in self.discover_plugins():plugin_path = os.path.join(self.plugins_dir, dir_name)is_system = dir_name in SYSTEM_PLUGINS- info = {'id': dir_name, 'name': dir_name, 'version': 'N/A', 'description': 'No description provided.', 'path': plugin_path, 'system': is_system}+ info = {+ 'id': dir_name,+ 'name': dir_name,+ 'version': 'N/A',+ 'description': 'No description provided.',+ 'path': plugin_path,+ 'system': is_system,+ 'uninstallable': True,+ }try:module = importlib.import_module(f"{dir_name}.plugin")for name, obj in inspect.getmembers(module, inspect.isclass):@@ -173,6 +181,7 @@ class PluginManager:info['name'] = instance.nameinfo['version'] = instance.versioninfo['description'] = instance.description+ info['uninstallable'] = bool(getattr(instance, 'uninstallable', True))breakexcept Exception as e:print(f"Could not load metadata for plugin {dir_name}: {e}")@@ -188,12 +197,25 @@ class PluginManager:else:raise+ def _is_plugin_uninstallable(self, plugin_id: str) -> bool:+ if plugin_id in SYSTEM_PLUGINS:+ return False+ try:+ for info in self.get_plugins_info():+ if info.get('id') == plugin_id:+ return bool(info.get('uninstallable', True))+ except Exception:+ pass+ return True+def uninstall_plugin(self, plugin_id: str):if not plugin_id:return "[Error] No plugin selected for uninstallation."if plugin_id in SYSTEM_PLUGINS:return f"[Error] Cannot uninstall system plugin '{plugin_id}'."+ if not self._is_plugin_uninstallable(plugin_id):+ return f"[Error] Cannot uninstall protected plugin '{plugin_id}'."target_dir = os.path.join(self.plugins_dir, plugin_id)if not os.path.isdir(target_dir):diff --git a/wgp.py b/wgp.pyindex 8c14802..7848bbd 100644--- a/wgp.py+++ b/wgp.py@@ -85,8 +85,8 @@ AUTOSAVE_TEMPLATE_PATH = AUTOSAVE_FILENAMECONFIG_FILENAME = "wgp_config.json"PROMPT_VARS_MAX = 10target_mmgp_version = "3.7.2"-WanGP_version = "10.50"-settings_version = 2.43+WanGP_version = "10.51"+settings_version = 2.44max_source_video_frames = 3000prompt_enhancer_image_caption_model, prompt_enhancer_image_caption_processor, prompt_enhancer_llm_model, prompt_enhancer_llm_tokenizer = None, None, None, Noneimage_names_list = ["image_start", "image_end", "image_refs"]@@ -5479,6 +5479,7 @@ def generate_video(pace,exaggeration,temperature,+ top_k,output_filename,state,model_type,@@ -6244,6 +6245,10 @@ def generate_video(extra_generate_kwargs = {}if audio_only and duration_def is not None:extra_generate_kwargs["duration_seconds"] = duration_seconds+ if audio_only and model_def.get("guidance_max_phases", 0) >= 1:+ extra_generate_kwargs["cfg_scale"] = guidance_scale+ if audio_only and model_def.get("top_k_slider", False):+ extra_generate_kwargs["top_k"] = top_ksamples = wan_model.generate(input_prompt = prompt,alt_prompt = alt_prompt,@@ -7595,6 +7600,8 @@ def prepare_inputs_dict(target, inputs, model_type = None, model_filename = Nonepop += [ "pace", "exaggeration", "temperature"]if model_def.get("duration_slider", None) is None:pop += ["duration_seconds"]+ if not model_def.get("top_k_slider", False):+ pop += ["top_k"]if "force_fps" in inputs and len(inputs["force_fps"])== 0:pop += ["force_fps"]@@ -8327,6 +8334,7 @@ def save_inputs(pace,exaggeration,temperature,+ top_k,output_filename,mode,state,@@ -9743,7 +9751,32 @@ def generate_video_tab(update_form = False, state_dict = None, ui_defaults = Nonalt_guidance_scale = gr.Slider(1.0, 20.0, value=ui_get("alt_guidance_scale"), step=0.5, label= alt_guidance_type if any_alt_guidance else "" , visible=any_alt_guidance, show_reset_button= False )with gr.Row(visible=audio_only) as temperature_row:- temperature = gr.Slider( 0.1, 1.5, value=ui_get("temperature"), step=0.01, label="Temperature", show_reset_button= False)+ temperature = gr.Slider(0.1, 1.5, value=ui_get("temperature"), step=0.01, label="Temperature", show_reset_button=False)++ top_k_visible = audio_only and model_def.get("top_k_slider", False)+ top_k_min = 0+ top_k_max = 100+ top_k_step = 1+ top_k_default = 50+ top_k_label = "Top-k"+ top_k_value = ui_get("top_k", top_k_default)+ try:+ top_k_value = int(top_k_value)+ except Exception:+ top_k_value = int(top_k_default)+ if top_k_value < top_k_min:+ top_k_value = top_k_min+ elif top_k_value > top_k_max:+ top_k_value = top_k_max+ with gr.Row(visible=top_k_visible) as top_k_row:+ top_k = gr.Slider(+ top_k_min,+ top_k_max,+ value=top_k_value,+ step=top_k_step,+ label=top_k_label,+ show_reset_button=False,+ )sample_solver_choices = model_def.get("sample_solvers", None)any_flow_shift = model_def.get("flow_shift", False)@@ -10243,7 +10276,7 @@ def generate_video_tab(update_form = False, state_dict = None, ui_defaults = Nonaudio_buttons_row, video_info_extract_audio_settings_btn, video_info_to_audio_guide_btn, video_info_to_audio_guide2_btn, video_info_to_audio_source_btn, video_info_eject_audio_btn,video_info_to_start_image_btn, video_info_to_end_image_btn, video_info_to_reference_image_btn, video_info_to_image_guide_btn, video_info_to_image_mask_btn,NAG_col, remove_background_sound , speakers_locations_row, embedded_guidance_row, guidance_phases_row, guidance_row, resolution_group, cfg_free_guidance_col, control_net_weights_row, guide_selection_row, image_mode_tabs,- min_frames_if_references_col, motion_amplitude_col, video_prompt_type_alignment, prompt_enhancer_btn, tab_inpaint, tab_t2v, resolution_row, loras_tab, post_processing_tab, temperature_row, number_frames_row, negative_prompt_row, chatter_row] +\+ min_frames_if_references_col, motion_amplitude_col, video_prompt_type_alignment, prompt_enhancer_btn, tab_inpaint, tab_t2v, resolution_row, loras_tab, post_processing_tab, temperature_row, top_k_row, number_frames_row, negative_prompt_row, chatter_row] +\image_start_extra + image_end_extra + image_refs_extra # presets_column,if update_form:locals_dict = locals()