Replicate를 통해 제공되는 Meta의 MusicGen입니다. 텍스트 프롬프트나 참조 멜로디(stereo / melody / large 변형)로 음악을 만들고, 입력 클립을 이어서 생성할 수 있으며 MP3 또는 WAV로 출력합니다. 요청 길이의 초 단위로 과금됩니다.
콘솔의 Playground에서 별도 코드 없이 이 모델을 즉시 테스트할 수 있어요
이 모델의 사용법을 Claude, ChatGPT 등에 복사
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: cdt_your_api_key" \
-d '{
"model": "meta/musicgen",
"input": {
"prompt": "Upbeat K-pop electro-pop company jingle instrumental, 128 BPM, synth brass stabs, punchy drums, bright synth lead, catchy hook, fun and playful",
"model_version": "stereo-melody-large",
"duration": 30,
"output_format": "mp3"
}
}'| 파라미터 | 타입 | 필수 | 기본값 | 설명 |
|---|---|---|---|---|
prompt | string | Yes | - | 생성할 음악 설명 |
model_version | string | No | stereo-melody-large | 모델 변형. stereo-*는 스테레오, melody-*는 input_audio를 멜로디 참조로 사용 stereo-melody-largestereo-largemelody-largelarge |
duration | integer | No | 8 | 생성 길이(초, 1-30). 초당 과금 |
input_audio | string | No | - | 출력에 영향을 주는 오디오. continuation이면 이어 만들고, 아니면 멜로디를 모방(melody 모델) |
continuation | boolean | No | false | true면 input_audio에 이어서 생성 |
continuation_start | integer | No | 0 | continuation에 쓸 input_audio 시작 시각(초) |
continuation_end | integer | No | - | continuation에 쓸 input_audio 종료 시각(초). 생략하면 끝까지 |
multi_band_diffusion | boolean | No | false | EnCodec 토큰을 MultiBand Diffusion으로 디코딩(비스테레오 모델만) |
normalization_strategy | string | No | loudness | 오디오 정규화 방식 loudnessclippeakrms |
top_k | integer | No | 250 | 상위 k개 토큰으로 샘플링 제한 |
top_p | number | No | 0 | 누적 확률 샘플링. 0이면 top_k 사용 |
temperature | number | No | 1 | 샘플링 온도. 높을수록 다양 |
classifier_free_guidance | integer | No | 3 | 입력의 영향력. 높을수록 프롬프트를 더 따름 |
output_format | string | No | wav | 출력 형식 wavmp3 |
seed | integer | No | - | 랜덤 시드. 생략 또는 -1이면 무작위 |
이 모델의 input_audio 파라미터에 파일을 전달하는 방법은 3가지입니다.
공개 접근 가능한 URL을 직접 전달합니다. Storage API(POST /v1/files/upload-url)로 업로드하면 파일이 S3로 직접 올라가고(파일당 50MB), 반환된 file_url을 그대로 쓰면 됩니다.
{
"model": "meta/musicgen",
"input": {
"prompt": "your prompt here",
"input_audio": "https://example.com/image.jpg"
}
}POST /v1/predictions/upload에 파일을 직접 첨부합니다. 별도 업로드 과정이 없는 대신, 파일이 API 서버를 거치므로 요청 전체 10MB 제한이 적용됩니다.
curl -X POST "https://api.core.today/v1/predictions/upload" \
-H "X-API-Key: cdt_your_api_key" \
-F "model=meta/musicgen" \
-F 'input={"prompt":"your prompt here"}' \
-F "file:input_audio=@your_file.png"POST /v1/predictions 요청 시 사용되는 공통 파라미터입니다.
| 파라미터 | 타입 | 필수 | 기본값 | 설명 |
|---|---|---|---|---|
model | string | Yes | - | 모델 식별자 |
input | object | Yes | - | 위 테이블의 모델별 파라미터를 포함하는 객체 |
output_folder | string | No | - | 결과물 저장 폴더 경로 (최대 256자, '..' 사용 불가) |
webhook_url | string | No | - | 완료 시 호출할 Webhook URL |
is_public | boolean | No | false | true 시 결과물을 영구 공개 URL로도 제공 |
모든 연주곡 모델에 같은 테마 프롬프트를 주고 만든 공통 샘플 — 결과를 나란히 비교해 보세요
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: cdt_your_api_key" \
-d '{
"model": "meta/musicgen",
"input": {
"prompt": "Upbeat K-pop electro-pop company jingle instrumental, 128 BPM, synth brass stabs, punchy drums, bright synth lead, catchy hook, fun and playful",
"model_version": "stereo-melody-large",
"duration": 30,
"output_format": "mp3"
}
}'stereo-large 변형과 MP3 출력, 기본 길이
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: cdt_your_api_key" \
-d '{
"model": "meta/musicgen",
"input": {
"prompt": "Triumphant cinematic orchestral melody in G major leading to a crescendo",
"model_version": "stereo-large",
"duration": 8,
"output_format": "mp3"
}
}'모노 large 변형으로 최대 길이 — 약 270 크레딧
curl -X POST "https://api.core.today/v1/predictions" \
-H "Content-Type: application/json" \
-H "X-API-Key: cdt_your_api_key" \
-d '{
"model": "meta/musicgen",
"input": {
"prompt": "Acoustic guitar folk melody, gentle and warm",
"model_version": "large",
"duration": 30,
"output_format": "mp3"
}
}'