[feat] Add stable_audio T2A Generation#1080
[feat] Add stable_audio T2A Generation#1080happy-harvey wants to merge 1 commit intohao-ai-lab:mainfrom
Conversation
Summary of ChangesHello @happy-harvey, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly extends the FastVideo library by introducing robust Text-to-Audio generation capabilities. It integrates the Stable Audio Open model, providing a complete pipeline from text prompt to audio waveform. The changes encompass new model configurations, specialized pipeline stages for audio processing, and an updated API, making it straightforward for users to leverage this new functionality. The addition of comprehensive documentation and examples ensures a smooth onboarding experience for generating high-quality audio from textual descriptions. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces text-to-audio generation capabilities using the Stable Audio Open model. The changes are extensive and well-executed, including the core pipeline implementation, new configuration files, a command-line example, comprehensive documentation, and both smoke and parity tests to ensure correctness. The integration with the existing VideoGenerator and model loading infrastructure is thoughtfully handled, particularly the support for Stable Audio's unified checkpoint format. I've found one minor issue in a utility function within the example script that could be improved for robustness.
| audio_np = np.clip(audio_np, -1.0, 1.0) | ||
| audio_int16 = (audio_np * 32767.0).astype(np.int16) | ||
| if audio_int16.ndim == 1: | ||
| audio_int16 = audio_int16[:, None] |
There was a problem hiding this comment.
The logic for handling 1D (mono) audio arrays is incorrect. Reshaping a 1D array of shape (T,) to (T, 1) using [:, None] results in num_channels being incorrectly interpreted as T and num_frames as 1 in the subsequent lines. To correctly handle mono audio, the array should be reshaped to (1, T). While this may not affect the current Stable Audio model which produces stereo output, fixing this will make the save_audio_wav utility function more robust for general use.
| audio_int16 = audio_int16[:, None] | |
| audio_int16 = audio_int16[np.newaxis, :] |
d9ffee4 to
911861e
Compare
911861e to
5b1e28c
Compare
No description provided.