Skip to content

Fix UnicodeDecodeError from subprocess stderr and set MP3 format in workflow SaveAudio nodes#13

Merged
lmangani merged 2 commits intomainfrom
copilot/fix-utf8-decoding-issue
Mar 14, 2026
Merged

Fix UnicodeDecodeError from subprocess stderr and set MP3 format in workflow SaveAudio nodes#13
lmangani merged 2 commits intomainfrom
copilot/fix-utf8-decoding-issue

Conversation

Copy link
Contributor

Copilot AI commented Mar 14, 2026

After successful generation, dit-vae writes non-UTF-8 binary data to stderr, causing Python's subprocess.run(..., text=True) to raise a UnicodeDecodeError. Additionally, all workflow examples left SaveAudio at ComfyUI's default FLAC format rather than MP3, which is what acestep-cpp produces.

Changes

  • nodes.py: Replace text=True with encoding='utf-8', errors='replace' on both subprocess.run calls (ace-qwen3 and dit-vae). Invalid bytes are replaced instead of raising, while stderr text is still captured for error reporting.
# Before
lm_result = subprocess.run(lm_cmd, capture_output=True, text=True, cwd=tmpdir)

# After
lm_result = subprocess.run(lm_cmd, capture_output=True, encoding='utf-8', errors='replace', cwd=tmpdir)
  • workflow-examples/*.json: Add "mp3" as the second widgets_values entry on every SaveAudio node across all four workflow files, overriding ComfyUI's FLAC default.

  • tests/test_workflows.py: Add test_save_audio_format_is_mp3 to assert that SaveAudio nodes explicitly declare "mp3" format.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

… SaveAudio nodes

Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix utf-8 decoding issue after output generation Fix UnicodeDecodeError from subprocess stderr and set MP3 format in workflow SaveAudio nodes Mar 14, 2026
Copilot AI requested a review from lmangani March 14, 2026 15:38
@lmangani lmangani marked this pull request as ready for review March 14, 2026 15:40
@lmangani lmangani merged commit 5e67d94 into main Mar 14, 2026
2 checks passed
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.

2 participants