-
Notifications
You must be signed in to change notification settings - Fork 492
[BugFix] Standardize StableAudio audio output #842
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
hsliuustc0106
merged 18 commits into
vllm-project:main
from
LudovicoYIN:fix-text-to-audio-output-and-docs
Jan 24, 2026
Merged
Changes from 11 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1bdef5f
[BugFix] Fix text_to_audio output handling and gated model note
LudovicoYIN ffc1537
[BugFix] Simplify text_to_audio output handling
LudovicoYIN b422593
[BugFix] Standardize StableAudio audio output and update exampleâ
LudovicoYIN a586389
Merge branch 'main' into fix-text-to-audio-output-and-docs
LudovicoYIN c93c4b4
Add SupportOutputType for StableAudio output
LudovicoYIN d854f3c
Merge branch 'main' into fix-text-to-audio-output-and-docs
LudovicoYIN 18da606
Merge branch 'main' into fix-text-to-audio-output-and-docs
LudovicoYIN 3bba3dd
Merge branch 'vllm-project:main' into fix-text-to-audio-output-and-docs
LudovicoYIN 808203b
Add output_type protocol and rename SupportImageInput
LudovicoYIN 73e33c8
Merge branch 'main' into fix-text-to-audio-output-and-docs
LudovicoYIN 5be10c9
Update stable audio test for multimodal_output
LudovicoYIN 58e43a1
Add support_audio_output flag and rename SupportImageInput
LudovicoYIN c433b22
Merge branch 'main' into fix-text-to-audio-output-and-docs
LudovicoYIN 1149d50
Fix lint
LudovicoYIN 8fa6b5f
Merge branch 'main' into fix-text-to-audio-output-and-docs
LudovicoYIN 60d96df
Replace output_type with support_audio_output helper
LudovicoYIN ad01f2b
Merge branch 'main' into fix-text-to-audio-output-and-docs
hsliuustc0106 8c6d35d
Merge branch 'main' into fix-text-to-audio-output-and-docs
hsliuustc0106 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,14 +123,18 @@ def step(self, requests: list[OmniDiffusionRequest]): | |
| return None | ||
|
|
||
| postprocess_start_time = time.time() | ||
| images = self.post_process_func(output.output) if self.post_process_func is not None else output.output | ||
| outputs = self.post_process_func(output.output) if self.post_process_func is not None else output.output | ||
| postprocess_time = time.time() - postprocess_start_time | ||
| logger.info(f"Post-processing completed in {postprocess_time:.4f} seconds") | ||
|
|
||
| # Convert to OmniRequestOutput format | ||
| # Ensure images is a list | ||
| if not isinstance(images, list): | ||
| images = [images] if images is not None else [] | ||
| # Ensure outputs is a list | ||
| if not isinstance(outputs, list): | ||
| outputs = [outputs] if outputs is not None else [] | ||
|
|
||
| model_cls = DiffusionModelRegistry._try_load_model_cls(self.od_config.model_class_name) | ||
|
||
| output_type = getattr(model_cls, "output_type", "image") if model_cls is not None else "image" | ||
| is_audio_output = output_type == "audio" | ||
|
|
||
| # Handle single request or multiple requests | ||
| if len(requests) == 1: | ||
|
|
@@ -145,18 +149,30 @@ def step(self, requests: list[OmniDiffusionRequest]): | |
| if output.trajectory_timesteps is not None: | ||
| metrics["trajectory_timesteps"] = output.trajectory_timesteps | ||
|
|
||
| return OmniRequestOutput.from_diffusion( | ||
| request_id=request_id, | ||
| images=images, | ||
| prompt=prompt, | ||
| metrics=metrics, | ||
| latents=output.trajectory_latents, | ||
| ) | ||
| if is_audio_output: | ||
| audio_payload = outputs[0] if len(outputs) == 1 else outputs | ||
| return OmniRequestOutput.from_diffusion( | ||
| request_id=request_id, | ||
| images=[], | ||
| prompt=prompt, | ||
| metrics=metrics, | ||
| latents=output.trajectory_latents, | ||
| multimodal_output={"audio": audio_payload}, | ||
| final_output_type="audio", | ||
| ) | ||
| else: | ||
| return OmniRequestOutput.from_diffusion( | ||
| request_id=request_id, | ||
| images=outputs, | ||
| prompt=prompt, | ||
| metrics=metrics, | ||
| latents=output.trajectory_latents, | ||
| ) | ||
| else: | ||
| # Multiple requests: return list of OmniRequestOutput | ||
| # Split images based on num_outputs_per_prompt for each request | ||
| results = [] | ||
| image_idx = 0 | ||
| output_idx = 0 | ||
|
|
||
| for request in requests: | ||
| request_id = request.request_id or "" | ||
|
|
@@ -166,22 +182,38 @@ def step(self, requests: list[OmniDiffusionRequest]): | |
|
|
||
| # Get images for this request | ||
| num_outputs = request.num_outputs_per_prompt | ||
| request_images = images[image_idx : image_idx + num_outputs] if image_idx < len(images) else [] | ||
| image_idx += num_outputs | ||
| request_outputs = ( | ||
| outputs[output_idx : output_idx + num_outputs] if output_idx < len(outputs) else [] | ||
| ) | ||
| output_idx += num_outputs | ||
|
|
||
| metrics = {} | ||
| if output.trajectory_timesteps is not None: | ||
| metrics["trajectory_timesteps"] = output.trajectory_timesteps | ||
|
|
||
| results.append( | ||
| OmniRequestOutput.from_diffusion( | ||
| request_id=request_id, | ||
| images=request_images, | ||
| prompt=prompt, | ||
| metrics=metrics, | ||
| latents=output.trajectory_latents, | ||
| if is_audio_output: | ||
| audio_payload = request_outputs[0] if len(request_outputs) == 1 else request_outputs | ||
| results.append( | ||
| OmniRequestOutput.from_diffusion( | ||
| request_id=request_id, | ||
| images=[], | ||
| prompt=prompt, | ||
| metrics=metrics, | ||
| latents=output.trajectory_latents, | ||
| multimodal_output={"audio": audio_payload}, | ||
| final_output_type="audio", | ||
| ) | ||
| ) | ||
| else: | ||
| results.append( | ||
| OmniRequestOutput.from_diffusion( | ||
| request_id=request_id, | ||
| images=request_outputs, | ||
| prompt=prompt, | ||
| metrics=metrics, | ||
| latents=output.trajectory_latents, | ||
| ) | ||
| ) | ||
| ) | ||
|
|
||
| return results | ||
| except Exception as e: | ||
|
|
||
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yenuo26 PTAL