{
  "workflow_info": {
    "name": "Song Section",
    "description": "Section renderer for the song ledger (hook-first pipeline): ACE-Step 1.5 turbo renders one section under explicit bpm/key/time-signature locks, optionally timbre-conditioned on the approved hook via the core ReferenceTimbreAudio node - the arrangement stage never drifts away from the audited hook's sound",
    "version": "1.0.0",
    "author": "Oshun Platform",
    "category": "audio",
    "tags": ["audio", "music", "song-section", "hook-first", "ace-step", "2026-sota"],
    "estimated_time_seconds": 90,
    "gpu_requirement": "A6000"
  },
  "inputs": {
    "prompt": {
      "type": "string",
      "required": true,
      "description": "Section description tags (instrumentation, mood, arrangement density)"
    },
    "lyrics": {
      "type": "string",
      "default": "",
      "description": "Section lyrics; empty for instrumental sections"
    },
    "bpm": {
      "type": "integer",
      "default": 92,
      "min": 40,
      "max": 220,
      "description": "Tempo lock (the song ledger's per-section bpm)"
    },
    "keyscale": {
      "type": "string",
      "default": "C major",
      "description": "Key lock, e.g. 'C major' or 'E minor' (template-confirmed free string)"
    },
    "time_signature": {
      "type": "string",
      "default": "4",
      "description": "Time-signature lock (ACE numeric convention, e.g. '4' for 4/4, '3' for 3/4)"
    },
    "duration_seconds": {
      "type": "integer",
      "default": 24,
      "min": 8,
      "max": 120,
      "description": "Section length"
    },
    "use_hook_reference": {
      "type": "boolean",
      "default": false,
      "description": "Timbre-condition this section on the approved hook audio (requires hook_audio)"
    },
    "hook_audio": {
      "type": "string",
      "required": false,
      "description": "Uploaded hook audio filename (the winning hook's mix)"
    },
    "seed": {
      "type": "integer",
      "default": -1,
      "description": "Random seed (-1 for random)"
    }
  },
  "nodes": {
    "1": {
      "class_type": "CheckpointLoaderSimple",
      "inputs": {
        "ckpt_name": "ace_step_1.5_turbo_aio.safetensors"
      },
      "outputs": ["MODEL", "CLIP", "VAE"]
    },
    "2": {
      "class_type": "TextEncodeAceStepAudio1.5",
      "inputs": {
        "clip": ["1", 1],
        "tags": "{{prompt}}",
        "lyrics": "{{lyrics}}",
        "seed": "{{seed}}",
        "bpm": "{{bpm}}",
        "duration": "{{duration_seconds}}",
        "timesignature": "{{time_signature}}",
        "language": "en",
        "keyscale": "{{keyscale}}"
      },
      "outputs": ["CONDITIONING"]
    },
    "3": {
      "class_type": "ConditioningZeroOut",
      "inputs": {
        "conditioning": ["2", 0]
      },
      "outputs": ["CONDITIONING"]
    },
    "hook_load": {
      "class_type": "LoadAudio",
      "inputs": {
        "audio": "{{hook_audio}}"
      },
      "outputs": ["AUDIO"],
      "_condition": "{{use_hook_reference}}"
    },
    "hook_encode": {
      "class_type": "VAEEncodeAudio",
      "inputs": {
        "audio": ["hook_load", 0],
        "vae": ["1", 2]
      },
      "outputs": ["LATENT"],
      "_condition": "{{use_hook_reference}}"
    },
    "hook_timbre": {
      "class_type": "ReferenceTimbreAudio",
      "inputs": {
        "conditioning": ["2", 0],
        "latent": ["hook_encode", 0]
      },
      "outputs": ["CONDITIONING"],
      "_condition": "{{use_hook_reference}}",
      "_condition_passthrough": "conditioning",
      "_comment": "Core ACE-Step 1.5 reference-audio conditioning: the hook's encoded latent locks the section's timbre. With the toggle off the sampler consumes the plain text conditioning."
    },
    "4": {
      "class_type": "EmptyAceStep1.5LatentAudio",
      "inputs": {
        "seconds": "{{duration_seconds}}",
        "batch_size": 1
      },
      "outputs": ["LATENT"]
    },
    "5": {
      "class_type": "ModelSamplingAuraFlow",
      "inputs": {
        "model": ["1", 0],
        "shift": 3.0
      },
      "outputs": ["MODEL"]
    },
    "6": {
      "class_type": "KSampler",
      "inputs": {
        "model": ["5", 0],
        "positive": ["hook_timbre", 0],
        "negative": ["3", 0],
        "latent_image": ["4", 0],
        "seed": "{{seed}}",
        "steps": 8,
        "cfg": 1.0,
        "sampler_name": "euler",
        "scheduler": "simple",
        "denoise": 1.0
      },
      "outputs": ["LATENT"],
      "_comment": "ACE-Step 1.5 turbo reference: 8 steps, cfg 1, euler/simple, shift 3."
    },
    "7": {
      "class_type": "VAEDecodeAudio",
      "inputs": {
        "samples": ["6", 0],
        "vae": ["1", 2]
      },
      "outputs": ["AUDIO"]
    },
    "8": {
      "class_type": "AudioLimiter",
      "inputs": {
        "audio": ["7", 0],
        "ceiling_db": -1.0
      },
      "outputs": ["AUDIO"],
      "_comment": "Brickwall at -1 dBTP - the song ledger's true-peak policy ceiling."
    },
    "9": {
      "class_type": "SaveAudioMP3",
      "inputs": {
        "audio": ["8", 0],
        "filename_prefix": "song_section",
        "quality": "V0"
      },
      "outputs": []
    }
  },
  "output_spec": {
    "type": "audio",
    "format": "mp3",
    "codec": "pcm_s16le",
    "channels": 2,
    "description": "Song-ledger section master render",
    "audio_package": {
      "mixdown": {
        "artifact_id": "audio_mixdown",
        "path_template": "audio/{{job_id}}/mixdown/section-master.wav",
        "format": "wav",
        "sample_rate_hz": 48000,
        "bit_depth": 24,
        "channels": 2,
        "codec": "pcm_s24le"
      },
      "loudness": {
        "artifact_id": "loudness_report",
        "path_template": "audio/{{job_id}}/analysis/loudness-report.json",
        "format": "json",
        "standard": "spotify",
        "target_integrated_lufs": -14,
        "max_true_peak_dbtp": -1
      },
      "compliance": {
        "artifact_id": "audio_compliance_report",
        "path_template": "audio/{{job_id}}/analysis/audio-compliance-report.json",
        "format": "json",
        "loudness_tolerance_lufs": 1.0,
        "true_peak_tolerance_dbtp": 0.3,
        "max_clipping_percent": 0.1,
        "enforce_format_normalization": true
      },
      "cue_sheet": {
        "artifact_id": "cue_sheet",
        "path_template": "audio/{{job_id}}/metadata/cue-sheet.csv",
        "format": "csv",
        "include_timecode": true,
        "include_beat_markers": true,
        "include_sections": true
      }
    }
  },
  "custom_nodes_required": ["AudioLimiter"],
  "models_required": ["ace_step_1.5_turbo_aio.safetensors"]
}
