Skip to content

feat(skill): add cover and audio repainting support to acestep CLI#777

Merged
ChuxiJ merged 2 commits intomainfrom
feat/skill-cover-repainting-support
Mar 6, 2026
Merged

feat(skill): add cover and audio repainting support to acestep CLI#777
ChuxiJ merged 2 commits intomainfrom
feat/skill-cover-repainting-support

Conversation

@ChuxiJ
Copy link
Contributor

@ChuxiJ ChuxiJ commented Mar 6, 2026

Summary

  • Add cover command and --src-audio option to acestep.sh for song covers and audio repainting
  • Support --task-type (cover/repaint), --cover-strength, --repaint-start/end, --key-scale, --time-signature options
  • Encode source audio as base64 via python3 in completion mode (handles large files without shell arg limits)
  • Fix Cloudflare 1010 errors by adding User-Agent header to curl requests
  • Update SKILL.md with cover/repainting documentation and usage examples

Usage

# Cover a song
./scripts/acestep.sh cover song.mp3 -c "Rock cover" -l "[Verse] ..." --duration 120

# Repaint a specific region
./scripts/acestep.sh generate --src-audio song.mp3 --task-type repaint -c "Pop" --repaint-start 30 --repaint-end 60

# Generate with key/time signature
./scripts/acestep.sh generate "Jazz" --duration 60 --key-scale "E minor" --time-sig "4/4"

Test plan

  • cover command with compressed audio on cloud API — verified working
  • Help text displays correctly for new options
  • Existing generate and random commands unaffected
  • Native mode payload includes new parameters

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Introduced dedicated command for audio cover generation.
    • Added parameters for customizing cover strength and repainting settings (timing, key, signature).
    • Enhanced source audio file validation and support.
  • Documentation

    • Expanded documentation with detailed cover and audio repainting workflow examples, command usage, and API guidance.

Add `cover` command and audio input support to the acestep.sh script,
enabling song covers and audio repainting via both completion and native
API modes.

- Add `cover` command as shortcut for `generate --src-audio --task-type cover`
- Add --src-audio, --task-type, --cover-strength, --repaint-start, --repaint-end options
- Add --key-scale and --time-signature options for music attributes
- Encode audio as base64 via python3 for completion mode (avoids shell arg limits)
- Add User-Agent header to fix Cloudflare 1010 errors on large payloads
- Update SKILL.md with cover/repainting documentation and examples

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 6, 2026

📝 Walkthrough

Walkthrough

ACE-Step skill gains cover and audio repainting capabilities through documentation expansion and new CLI command implementation. The update introduces a cover command, new parameters for audio processing (src_audio, cover_strength, repaint_start, repaint_end, etc.), and dual-mode payload construction supporting both text and multipart audio inputs.

Changes

Cohort / File(s) Summary
Documentation
.claude/skills/acestep/SKILL.md
Added detailed sections for Cover / Audio Repainting workflows with command examples, API usage notes (including Cloudflare caveat for large files), and expanded JSON result structure documentation.
Script Implementation
.claude/skills/acestep/scripts/acestep.sh
Introduced cmd_cover command wrapper; added CLI parameters (--task-type, --src-audio, --cover-strength, --repaint-start, --repaint-end, --key-scale, --time-signature); implemented source audio file validation; expanded payload construction for dual modes (audio input with base64-encoded multipart data, and text input with new audio_config fields); updated command dispatch and help text.

Sequence Diagram

sequenceDiagram
    actor User
    participant CLI as ACE-Step CLI
    participant Validator as File Validator
    participant PayloadBuilder as Payload Constructor
    participant API as ACE-Step API

    User->>CLI: Execute cover command with --src-audio
    CLI->>Validator: Validate audio file exists
    Validator-->>CLI: File confirmed
    CLI->>PayloadBuilder: Build multipart payload with audio data
    PayloadBuilder->>PayloadBuilder: Encode audio to base64
    PayloadBuilder->>PayloadBuilder: Construct JSON with task_type, audio_config
    PayloadBuilder-->>CLI: Payload ready
    CLI->>API: Send curl request with multipart payload + metadata
    API-->>CLI: Return cover/repainting result
    CLI->>User: Display task completion with output details
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰 Whiskers twitching, ears held high,
Audio covers paint the sky!
Repainting notes with strength and care,
Cover commands float through the air. ✨🎵
New workflows blossom, parameters grow,
Watch this ACE-Step skill's grand show!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the main change: adding cover and audio repainting support to the acestep CLI, which is clearly reflected in both the documentation updates and the script modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/skill-cover-repainting-support

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
.claude/skills/acestep/scripts/acestep.sh (2)

925-929: Consider adding Python fallback for base64 encoding.

The decode_base64_audio function (lines 564-569) falls back to python if python3 is unavailable, but the encoding here only uses python3. For consistency and broader compatibility:

Suggested improvement
             local audio_b64_file=$(mktemp)
-            python3 -c "
+            if ! python3 -c "
 import base64, sys
 with open(sys.argv[1], 'rb') as f:
     sys.stdout.write(base64.b64encode(f.read()).decode('ascii'))
-" "$src_audio" > "$audio_b64_file"
+" "$src_audio" > "$audio_b64_file" 2>/dev/null; then
+                python -c "
+import base64, sys
+with open(sys.argv[1], 'rb') as f:
+    sys.stdout.write(base64.b64encode(f.read()).decode('ascii'))
+" "$src_audio" > "$audio_b64_file" || {
+                    echo -e "${RED}Error: python3 or python required for audio encoding${NC}"
+                    rm -f "$audio_b64_file"
+                    exit 1
+                }
+            fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/skills/acestep/scripts/acestep.sh around lines 925 - 929, The base64
encoding invocation currently hardcodes "python3" and should mirror the
decode_base64_audio fallback by using python3 if available otherwise falling
back to python; update the block that converts "$src_audio" into
"$audio_b64_file" (the inline Python snippet invoked for encoding) to first
detect command availability (e.g., via command -v python3 || command -v python)
and call the discovered interpreter to run the same base64 encode snippet so
both encoding and decode paths support systems where only "python" exists.

886-886: Static analysis: Declare and assign separately to avoid masking return values.

Per SC2155, combining local with command substitution masks the command's exit code.

Suggested fix
-    local api_mode=$(load_api_mode)
+    local api_mode
+    api_mode=$(load_api_mode)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/skills/acestep/scripts/acestep.sh at line 886, The command
substitution for api_mode currently combines declaration and assignment which
masks the exit status; change to declare the variable first (local api_mode) and
then assign via a separate command substitution (api_mode=$(load_api_mode)),
preserving the return code from load_api_mode so callers can detect failures —
update the occurrence that uses load_api_mode and the api_mode variable
accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.claude/skills/acestep/scripts/acestep.sh:
- Around line 925-929: The base64 encoding invocation currently hardcodes
"python3" and should mirror the decode_base64_audio fallback by using python3 if
available otherwise falling back to python; update the block that converts
"$src_audio" into "$audio_b64_file" (the inline Python snippet invoked for
encoding) to first detect command availability (e.g., via command -v python3 ||
command -v python) and call the discovered interpreter to run the same base64
encode snippet so both encoding and decode paths support systems where only
"python" exists.
- Line 886: The command substitution for api_mode currently combines declaration
and assignment which masks the exit status; change to declare the variable first
(local api_mode) and then assign via a separate command substitution
(api_mode=$(load_api_mode)), preserving the return code from load_api_mode so
callers can detect failures — update the occurrence that uses load_api_mode and
the api_mode variable accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 06f11776-10f6-449b-a6d7-c3fd134debfe

📥 Commits

Reviewing files that changed from the base of the PR and between 4da3a49 and f6b06c7.

📒 Files selected for processing (2)
  • .claude/skills/acestep/SKILL.md
  • .claude/skills/acestep/scripts/acestep.sh

@ChuxiJ ChuxiJ merged commit 26c3cf5 into main Mar 6, 2026
1 check passed
DumoeDss added a commit to ace-step/ace-step-skills that referenced this pull request Mar 7, 2026
…#777](ace-step/ACE-Step-1.5#777))

Add `cover` command and audio input support to the acestep.sh script,
enabling song covers and audio repainting via both completion and native
API modes.

- Add `cover` command as shortcut for `generate --src-audio --task-type cover`
- Add --src-audio, --task-type, --cover-strength, --repaint-start, --repaint-end options
- Add --key-scale and --time-signature options for music attributes
- Encode audio as base64 via python3 for completion mode (avoids shell arg limits)
- Add User-Agent header to fix Cloudflare 1010 errors on large payloads
- Update SKILL.md with cover/repainting documentation and examples

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant