- Add RunwareAudioInference node for text-to-audio generation - Add RunwareAudioModelSearch node for audio model selection - Add RunwareAudioSections node for music composition structure - Add RunwareElevenLabsProviderSettings node for advanced music generation - Add conditional parameter logic for positivePrompt and duration - Add debug logging for API error responses
57 lines
2.1 KiB
Python
57 lines
2.1 KiB
Python
class RunwareAudioSections:
|
|
def __init__(self):
|
|
pass
|
|
|
|
@classmethod
|
|
def INPUT_TYPES(cls):
|
|
return {
|
|
"required": {
|
|
"sectionName": ("STRING", {
|
|
"default": "intro",
|
|
"tooltip": "Name of the section"
|
|
}),
|
|
"positiveLocalStyles": ("STRING", {
|
|
"default": "guitar, buildup",
|
|
"tooltip": "Styles that should be present in this section (comma-separated)"
|
|
}),
|
|
"negativeLocalStyles": ("STRING", {
|
|
"default": "vocals",
|
|
"tooltip": "Styles that should not be present in this section (comma-separated)"
|
|
}),
|
|
"duration": ("INT", {
|
|
"default": 15,
|
|
"min": 3,
|
|
"max": 120,
|
|
"tooltip": "Duration of the section in seconds (3-120)"
|
|
}),
|
|
"lines": ("STRING", {
|
|
"multiline": True,
|
|
"default": "",
|
|
"tooltip": "Lyrics for the section (one line per line)"
|
|
}),
|
|
}
|
|
}
|
|
|
|
RETURN_TYPES = ("RUNWAREAUDIOSECTIONS",)
|
|
RETURN_NAMES = ("sections",)
|
|
FUNCTION = "create_sections"
|
|
CATEGORY = "Runware/Audio"
|
|
|
|
def create_sections(self, **kwargs):
|
|
sectionName = kwargs.get("sectionName", "")
|
|
positiveLocalStyles = kwargs.get("positiveLocalStyles", "")
|
|
negativeLocalStyles = kwargs.get("negativeLocalStyles", "")
|
|
duration = kwargs.get("duration", 0)
|
|
lines = kwargs.get("lines", "")
|
|
|
|
# Create section object
|
|
section = {
|
|
"sectionName": sectionName,
|
|
"positiveLocalStyles": [style.strip() for style in positiveLocalStyles.split(",") if style.strip()],
|
|
"negativeLocalStyles": [style.strip() for style in negativeLocalStyles.split(",") if style.strip()],
|
|
"duration": duration,
|
|
"lines": [line.strip() for line in lines.split("\n") if line.strip()]
|
|
}
|
|
|
|
return (section,)
|