Skip to content
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

Extend, Cover, Negative Tags and Upload (with progress) #184

Open
jochemstoel opened this issue Nov 5, 2024 · 4 comments
Open

Extend, Cover, Negative Tags and Upload (with progress) #184

jochemstoel opened this issue Nov 5, 2024 · 4 comments

Comments

@jochemstoel
Copy link

Hi, thanks for creating this repo. I need additional methods for: cover and upload, and parameter: negative_tags.

I have already done some research.

Implementing negative tags (exclude style) is easy, just add a property negative_tags to your HTTP request payload. This will work.
Extend is easy too, all you need to do is provide the ID of the song you want to extend.
Update: you have already implemented extend function, it will work the same with uploads (provide audio ID) but no uploads are supported yet.

I have been investigating the suno.com website but I haven't found the right way yet to "cover" an audio. This is a new feature on their platform. I assume it also required a track id.

The new "cover" method on Suno uses a much improved model compared to the regular generation model.
Source: Suno employee on Discord + own experience.

Lastly, trying to update your repository, I haven't been able to upload my audio files to Suno yet. I have found so far that when you upload a file on the suno website, it sends a request to /audio with a payload of:

{
    "extension": "wav" // or mp3
}

This will respond with:

{
    "id": "11b10f4c-6bf9-499b-8d49-f7bc4661bfcb",
    "url": "https://suno-uploads.s3.amazonaws.com/",
    "fields": {
        "Content-Type": "audio/wav",
        "key": "raw_uploads/11b10f4c-6bf9-499b-8d49-f7bc4661bfcb.wav",
        "AWSAccessKeyId": "...",
        "policy": "...",
        "signature": "..."
    },
    "is_file_uploaded": false
}

Then you need to request https://suno-uploads.s3.amazonaws.com/raw_uploads%2F11b10f4c-6bf9-499b-8d49-f7bc4661bfcb.wav (response.url + fields.key) and provide the file as payload.

Then a response comes from /upload-finish from Suno, followed by responses with progress indicators of the audio processing. For example:

{
    "id": "11b10f4c-6bf9-499b-8d49-f7bc4661bfcb",
    "status": "processing",
    "title": ""
}

But I get stuck on the uploading file to amazon. Authentication errors etcetera. Can you implement these features? I hope some of my findings are useful.

Update: there exists now the option to save the profile of a voice as a "persona". This is a very easy to implement endpoint too.

@uisato
Copy link

uisato commented Nov 10, 2024

Hey, are the cookies working for you, Joch? Can't seem to make it work, having the "Internal server error. Error: Failed to get session id, you may need to update the SUNO_COOKIE".

@jochemstoel
Copy link
Author

@uisato It works fine for me. I think what you are doing wrong is you're using the value stored in your document.cookie. The best way is to grab it in the way demonstrated in the network tab. If you do not get any results in sources when you type "clerk" into search or look for it, refresh the page with the devtools already open.

My issue however was about adding features, if you have cookie problems then ask your question where it is relevant please.

@uisato
Copy link

uisato commented Nov 10, 2024 via email

@uisato
Copy link

uisato commented Nov 10, 2024 via email

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

No branches or pull requests

2 participants