-
Notifications
You must be signed in to change notification settings - Fork 20
Added support for Fish Audio S2.1 #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| """ | ||
| Runware Audio Inference Inputs Reference Audio node. | ||
| Builds inputs.referenceVoices for zero-shot voice cloning (up to 4 entries). | ||
| """ | ||
|
|
||
| from typing import Any, Dict, List | ||
|
|
||
| from .utils import runwareUtils as rwUtils | ||
|
|
||
|
|
||
| class RunwareAudioInferenceReferenceVoices: | ||
| """Build inputs.referenceVoices[] for Fish Audio and other TTS models.""" | ||
|
|
||
| MAX_REFERENCE_VOICES = 4 | ||
|
|
||
| @classmethod | ||
| def INPUT_TYPES(cls): | ||
| optional_inputs = {} | ||
| for i in range(1, cls.MAX_REFERENCE_VOICES + 1): | ||
| ordinal = rwUtils.getOrdinal(i) | ||
| optional_inputs[f"useReferenceVoice{i}"] = ("BOOLEAN", { | ||
| "default": False, | ||
| "tooltip": f"Enable to include the {ordinal} reference voice in inputs.referenceVoices.", | ||
| }) | ||
| optional_inputs[f"audio{i}"] = ("STRING", { | ||
| "default": "", | ||
| "tooltip": f"Reference audio clip ({ordinal}) as media UUID, URL, or base64. Required when enabled.", | ||
| }) | ||
| optional_inputs[f"text{i}"] = ("STRING", { | ||
| "multiline": True, | ||
| "default": "", | ||
| "tooltip": f"Transcript of the {ordinal} reference audio clip (1–1000 characters). Required when enabled.", | ||
| }) | ||
|
|
||
| return { | ||
| "required": {}, | ||
| "optional": optional_inputs, | ||
| } | ||
|
|
||
| RETURN_TYPES = ("RUNWAREAUDIOINFERENCEREFERENCEVOICES",) | ||
| RETURN_NAMES = ("referenceVoices",) | ||
| FUNCTION = "createReferenceVoices" | ||
| CATEGORY = "Runware/Audio" | ||
| DESCRIPTION = ( | ||
| "Configure inputs.referenceVoices for zero-shot voice cloning (up to 4 entries). " | ||
| "Each entry: { \"audio\": \"<UUID/URL/base64>\", \"text\": \"<transcript>\" }. " | ||
| "Connect to Runware Audio Inference Inputs." | ||
| ) | ||
|
|
||
| def createReferenceVoices(self, **kwargs) -> tuple[List[Dict[str, Any]]]: | ||
| reference_voices: List[Dict[str, Any]] = [] | ||
|
|
||
| for i in range(1, self.MAX_REFERENCE_VOICES + 1): | ||
| if not kwargs.get(f"useReferenceVoice{i}", False): | ||
| continue | ||
|
|
||
| audio = (kwargs.get(f"audio{i}") or "").strip() | ||
| text = (kwargs.get(f"text{i}") or "").strip() | ||
|
|
||
| if not audio or not text: | ||
| continue | ||
|
|
||
| reference_voices.append({"audio": audio, "text": text}) | ||
|
|
||
| return (reference_voices,) | ||
|
|
||
|
|
||
| NODE_CLASS_MAPPINGS = { | ||
| "RunwareAudioInferenceReferenceVoices": RunwareAudioInferenceReferenceVoices, | ||
| } | ||
|
|
||
| NODE_DISPLAY_NAME_MAPPINGS = { | ||
| "RunwareAudioInferenceReferenceVoices": "Runware Audio Inference Inputs Reference Audio", | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.