|
Download docs/ko/API.md from dvanh/ace-studio-v3-mashup: direct link, hf CLI and curl.
- Browser
- Download file 17.9 kB
-
https://huggingface.co/dvanh/ace-studio-v3-mashup/resolve/main/docs/ko/API.md
- Command line
-
hf download hf://dvanh/ace-studio-v3-mashup/docs/ko/API.md
-
curl -L -o API.md https://huggingface.co/dvanh/ace-studio-v3-mashup/resolve/main/docs/ko/API.md
17.9 kB
| # ACE-Step API ํด๋ผ์ด์ธํธ ๋ฌธ์ | |
| **์ธ์ด / Language / ่ฏญ่จ / ่จ่ช:** [English](../en/API.md) | [ํ๊ตญ์ด](API.md) | [ไธญๆ](../zh/API.md) | [ๆฅๆฌ่ช](../ja/API.md) | |
| --- | |
| ์ด ์๋น์ค๋ HTTP ๊ธฐ๋ฐ์ ๋น๋๊ธฐ ์์ ์์ฑ API๋ฅผ ์ ๊ณตํฉ๋๋ค. | |
| **๊ธฐ๋ณธ ์ํฌํ๋ก์ฐ**: | |
| 1. `POST /release_task`๋ฅผ ํธ์ถํ์ฌ ์์ ์ ์ ์ถํ๊ณ `task_id`๋ฅผ ํ๋ํฉ๋๋ค. | |
| 2. `POST /query_result`๋ฅผ ํธ์ถํ์ฌ ์์ ์ํ๊ฐ `1`(์ฑ๊ณต) ๋๋ `2`(์คํจ)๊ฐ ๋ ๋๊น์ง ๋ฐฐ์น ์ฟผ๋ฆฌ๋ฅผ ์ํํฉ๋๋ค. | |
| 3. ๊ฒฐ๊ณผ์ ๋ฐํ๋ `GET /v1/audio?path=...` URL์ ํตํด ์ค๋์ค ํ์ผ์ ๋ค์ด๋ก๋ํฉ๋๋ค. | |
| --- | |
| ## ๋ชฉ์ฐจ | |
| - [1. ์ธ์ฆ](#1-์ธ์ฆ) | |
| - [2. ์๋ต ํ์](#2-์๋ต-ํ์) | |
| - [3. ์์ ์ํ ์ค๋ช ](#3-์์ -์ํ-์ค๋ช ) | |
| - [4. ์์ฑ ์์ ์์ฑ](#4-์์ฑ-์์ -์์ฑ) | |
| - [5. ์์ ๊ฒฐ๊ณผ ๋ฐฐ์น ์กฐํ](#5-์์ -๊ฒฐ๊ณผ-๋ฐฐ์น-์กฐํ) | |
| - [6. ์ ๋ ฅ ํฌ๋งทํ (Format Input)](#6-์ ๋ ฅ-ํฌ๋งทํ -format-input) | |
| - [7. ๋๋ค ์ํ ๊ฐ์ ธ์ค๊ธฐ](#7-๋๋ค-์ํ-๊ฐ์ ธ์ค๊ธฐ) | |
| - [8. ์ฌ์ฉ ๊ฐ๋ฅํ ๋ชจ๋ธ ๋ชฉ๋ก](#8-์ฌ์ฉ-๊ฐ๋ฅํ-๋ชจ๋ธ-๋ชฉ๋ก) | |
| - [9. ์๋ฒ ํต๊ณ](#9-์๋ฒ-ํต๊ณ) | |
| - [10. ์ค๋์ค ํ์ผ ๋ค์ด๋ก๋](#10-์ค๋์ค-ํ์ผ-๋ค์ด๋ก๋) | |
| - [11. ํฌ์ค ์ฒดํฌ](#11-ํฌ์ค-์ฒดํฌ) | |
| - [12. ํ๊ฒฝ ๋ณ์](#12-ํ๊ฒฝ-๋ณ์) | |
| --- | |
| ## 1. ์ธ์ฆ | |
| API๋ ์ ํ์ ์ผ๋ก API ํค ์ธ์ฆ์ ์ง์ํฉ๋๋ค. ํ์ฑํ๋ ๊ฒฝ์ฐ ์์ฒญ ์ ์ ํจํ ํค๋ฅผ ์ ๊ณตํด์ผ ํฉ๋๋ค. | |
| ### ์ธ์ฆ ๋ฐฉ๋ฒ | |
| ๋ ๊ฐ์ง ์ธ์ฆ ๋ฐฉ๋ฒ์ ์ง์ํฉ๋๋ค: | |
| **๋ฐฉ๋ฒ A: ์์ฒญ ๋ณธ๋ฌธ์ ai_token** | |
| ```json | |
| { | |
| "ai_token": "your-api-key", | |
| "prompt": "upbeat pop song", | |
| ... | |
| } | |
| ``` | |
| **๋ฐฉ๋ฒ B: Authorization ํค๋** | |
| ```bash | |
| curl -X POST http://localhost:8001/release_task \ | |
| -H 'Authorization: Bearer your-api-key' \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{"prompt": "upbeat pop song"}' | |
| ``` | |
| --- | |
| ## 2. ์๋ต ํ์ | |
| ๋ชจ๋ API ์๋ต์ ํตํฉ ๋ํผ ํ์์ ์ฌ์ฉํฉ๋๋ค: | |
| ```json | |
| { | |
| "data": { ... }, | |
| "code": 200, | |
| "error": null, | |
| "timestamp": 1700000000000, | |
| "extra": null | |
| } | |
| ``` | |
| | ํ๋ | ํ์ | ์ค๋ช | | |
| | :--- | :--- | :--- | | |
| | `data` | any | ์ค์ ์๋ต ๋ฐ์ดํฐ | | |
| | `code` | int | ์ํ ์ฝ๋ (200=์ฑ๊ณต) | | |
| | `error` | string | ์๋ฌ ๋ฉ์์ง (์ฑ๊ณต ์ null) | | |
| | `timestamp` | int | ์๋ต ํ์์คํฌํ (๋ฐ๋ฆฌ์ด) | | |
| | `extra` | any | ์ถ๊ฐ ์ ๋ณด (๋ณดํต null) | | |
| --- | |
| ## 3. ์์ ์ํ ์ค๋ช | |
| ์์ ์ํ(`status`)๋ ์ ์๋ก ํํ๋ฉ๋๋ค: | |
| | ์ํ ์ฝ๋ | ์ํ ์ด๋ฆ | ์ค๋ช | | |
| | :--- | :--- | :--- | | |
| | `0` | ๋๊ธฐ ์ค/์คํ ์ค | ์์ ์ด ๋๊ธฐ์ด์ ์๊ฑฐ๋ ์งํ ์ค์ | | |
| | `1` | ์ฑ๊ณต | ์์ฑ์ด ์ฑ๊ณต์ ์ด๋ฉฐ ๊ฒฐ๊ณผ๊ฐ ์ค๋น๋จ | | |
| | `2` | ์คํจ | ์์ฑ ์คํจ | | |
| --- | |
| ## 4. ์์ฑ ์์ ์์ฑ | |
| ### 4.1 API ์ ์ | |
| - **URL**: `/release_task` | |
| - **Method**: `POST` | |
| - **Content-Type**: `application/json`, `multipart/form-data`, ๋๋ `application/x-www-form-urlencoded` | |
| ### 4.2 ์์ฒญ ํ๋ผ๋ฏธํฐ | |
| #### ํ๋ผ๋ฏธํฐ ๋ช ๋ช ๊ท์น | |
| API๋ ๋๋ถ๋ถ์ ํ๋ผ๋ฏธํฐ์ ๋ํด **snake_case**์ **camelCase** ๋ช ๋ช ์ ๋ชจ๋ ์ง์ํฉ๋๋ค. ์: | |
| - `audio_duration` / `duration` / `audioDuration` | |
| - `key_scale` / `keyscale` / `keyScale` | |
| - `time_signature` / `timesignature` / `timeSignature` | |
| - `sample_query` / `sampleQuery` / `description` / `desc` | |
| - `use_format` / `useFormat` / `format` | |
| ๋ํ ๋ฉํ๋ฐ์ดํฐ๋ ์ค์ฒฉ๋ ๊ฐ์ฒด(`metas`, `metadata`, ๋๋ `user_metadata`)๋ก ์ ๋ฌํ ์ ์์ต๋๋ค. | |
| #### ๋ฐฉ๋ฒ A: JSON ์์ฒญ (application/json) | |
| ํ ์คํธ ํ๋ผ๋ฏธํฐ๋ง ์ ๋ฌํ๊ฑฐ๋ ์๋ฒ์ ์ด๋ฏธ ์กด์ฌํ๋ ์ค๋์ค ํ์ผ ๊ฒฝ๋ก๋ฅผ ์ฐธ์กฐํ ๋ ์ ํฉํฉ๋๋ค. | |
| **๊ธฐ๋ณธ ํ๋ผ๋ฏธํฐ**: | |
| | ํ๋ผ๋ฏธํฐ ๋ช | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช | | |
| | :--- | :--- | :--- | :--- | | |
| | `prompt` | string | `""` | ์์ ์ค๋ช ํ๋กฌํํธ (๋ณ์นญ: `caption`) | | |
| | `lyrics` | string | `""` | ๊ฐ์ฌ ๋ด์ฉ | | |
| | `thinking` | bool | `false` | 5Hz LM์ ์ฌ์ฉํ์ฌ ์ค๋์ค ์ฝ๋๋ฅผ ์์ฑํ ์ง ์ฌ๋ถ (lm-dit ๋์) | | |
| | `vocal_language` | string | `"en"` | ๊ฐ์ฌ ์ธ์ด (en, zh, ja ๋ฑ) | | |
| | `audio_format` | string | `"mp3"` | ์ถ๋ ฅ ํ์ (mp3, wav, flac) | | |
| **์ํ/์ค๋ช ๋ชจ๋ ํ๋ผ๋ฏธํฐ**: | |
| | ํ๋ผ๋ฏธํฐ ๋ช | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช | | |
| | :--- | :--- | :--- | :--- | | |
| | `sample_mode` | bool | `false` | ๋๋ค ์ํ ์์ฑ ๋ชจ๋ ํ์ฑํ (LM์ ํตํด ์บก์ /๊ฐ์ฌ/๋ฉํ๋ฐ์ดํฐ ์๋ ์์ฑ) | | |
| | `sample_query` | string | `""` | ์ํ ์์ฑ์ ์ํ ์์ฐ์ด ์ค๋ช (์: "์กฐ์ฉํ ์ ๋ ์ ์ํ ๋ถ๋๋ฌ์ด ๋ฒต๊ณจ์ด ์ฌ๋ ๋ ธ๋"). ๋ณ์นญ: `description`, `desc` | | |
| | `use_format` | bool | `false` | LM์ ์ฌ์ฉํ์ฌ ์ ๊ณต๋ ์บก์ ๊ณผ ๊ฐ์ฌ๋ฅผ ๊ฐ์ /ํฌ๋งทํ ํฉ๋๋ค. ๋ณ์นญ: `format` | | |
| **๋ค์ค ๋ชจ๋ธ ์ง์**: | |
| | ํ๋ผ๋ฏธํฐ ๋ช | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช | | |
| | :--- | :--- | :--- | :--- | | |
| | `model` | string | null | ์ฌ์ฉํ DiT ๋ชจ๋ธ ์ ํ (์: `"acestep-v15-turbo"`, `"acestep-v15-turbo-shift3"`). `/v1/models`๋ฅผ ์ฌ์ฉํ์ฌ ๊ฐ๋ฅํ ๋ชจ๋ธ ๋ชฉ๋ก์ ํ์ธํ์ธ์. ์ง์ ํ์ง ์์ผ๋ฉด ๊ธฐ๋ณธ ๋ชจ๋ธ์ ์ฌ์ฉํฉ๋๋ค. | | |
| **thinking ์๋ฏธ๋ก (์ค์)**: | |
| - `thinking=false`: | |
| - ์๋ฒ๋ `audio_code_string`์ ์์ฑํ๊ธฐ ์ํด 5Hz LM์ ์ฌ์ฉํ์ง **์์ต๋๋ค**. | |
| - DiT๋ **text2music** ๋ชจ๋์์ ์คํ๋๋ฉฐ ์ ๊ณต๋ `audio_code_string`์ **๋ฌด์**ํฉ๋๋ค. | |
| - `thinking=true`: | |
| - ์๋ฒ๋ `audio_code_string`์ ์์ฑํ๊ธฐ ์ํด 5Hz LM์ ์ฌ์ฉํฉ๋๋ค (lm-dit ๋์). | |
| - DiT๋ ํฅ์๋ ์์ ํ์ง์ ์ํด LM์ด ์์ฑํ ์ฝ๋๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์คํ๋ฉ๋๋ค. | |
| **๋ฉํ๋ฐ์ดํฐ ์๋ ์์ฑ (์กฐ๊ฑด๋ถ)**: | |
| `use_cot_caption=true` ๋๋ `use_cot_language=true`์ด๊ฑฐ๋ ๋ฉํ๋ฐ์ดํฐ ํ๋๊ฐ ๋๋ฝ๋ ๊ฒฝ์ฐ, ์๋ฒ๋ `caption`/`lyrics`๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ๋๋ฝ๋ ํ๋๋ฅผ ์ฑ์ฐ๊ธฐ ์ํด 5Hz LM์ ํธ์ถํ ์ ์์ต๋๋ค: | |
| - `bpm` | |
| - `key_scale` | |
| - `time_signature` | |
| - `audio_duration` | |
| ์ฌ์ฉ์๊ฐ ์ ๊ณตํ ๊ฐ์ด ํญ์ ์ฐ์ ํ๋ฉฐ, LM์ ๋น์ด ์๊ฑฐ๋ ๋๋ฝ๋ ํ๋๋ง ์ฑ์๋๋ค. | |
| **์์ ์์ฑ ํ๋ผ๋ฏธํฐ**: | |
| | ํ๋ผ๋ฏธํฐ ๋ช | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช | | |
| | :--- | :--- | :--- | :--- | | |
| | `bpm` | int | null | ํ ํฌ(BPM) ์ง์ , ๋ฒ์ 30-300 | | |
| | `key_scale` | string | `""` | ํค/์ค์ผ์ผ (์: "C Major", "Am"). ๋ณ์นญ: `keyscale`, `keyScale` | | |
| | `time_signature` | string | `""` | ๋ฐ์ ๊ธฐํธ (2/4, 3/4, 4/4, 6/8์ ๊ฒฝ์ฐ 2, 3, 4, 6). ๋ณ์นญ: `timesignature`, `timeSignature` | | |
| | `audio_duration` | float | null | ์์ฑ ๊ธธ์ด (์ด), ๋ฒ์ 10-600. ๋ณ์นญ: `duration`, `target_duration` | | |
| **์ค๋์ค ์ฝ๋ (์ ํ ์ฌํญ)**: | |
| | ํ๋ผ๋ฏธํฐ ๋ช | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช | | |
| | :--- | :--- | :--- | :--- | | |
| | `audio_code_string` | string or string[] | `""` | `llm_dit`๋ฅผ ์ํ ์ค๋์ค ์๋งจํฑ ํ ํฐ(5Hz) ๋ฌธ์์ด. ๋ณ์นญ: `audioCodeString` | | |
| **์์ฑ ์ ์ด ํ๋ผ๋ฏธํฐ**: | |
| | ํ๋ผ๋ฏธํฐ ๋ช | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช | | |
| | :--- | :--- | :--- | :--- | | |
| | `inference_steps` | int | `8` | ์ถ๋ก ๋จ๊ณ ์. Turbo ๋ชจ๋ธ: 1-20 (๊ถ์ฅ 8). Base ๋ชจ๋ธ: 1-200 (๊ถ์ฅ 32-64). | | |
| | `guidance_scale` | float | `7.0` | ํ๋กฌํํธ ๊ฐ์ด๋ ๊ณ์. Base ๋ชจ๋ธ์์๋ง ์ ํจํฉ๋๋ค. | | |
| | `use_random_seed` | bool | `true` | ๋๋ค ์๋ ์ฌ์ฉ ์ฌ๋ถ | | |
| | `seed` | int | `-1` | ์๋ ์ง์ (use_random_seed=false์ผ ๋) | | |
| | `batch_size` | int | `2` | ๋ฐฐ์น ์์ฑ ์ (์ต๋ 8) | | |
| **๊ณ ๊ธ DiT ํ๋ผ๋ฏธํฐ**: | |
| | ํ๋ผ๋ฏธํฐ ๋ช | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช | | |
| | :--- | :--- | :--- | :--- | | |
| | `shift` | float | `3.0` | ํ์์คํ ์ํํธ ๊ณ์ (๋ฒ์ 1.0-5.0). Turbo ๋ชจ๋ธ์ด ์๋ Base ๋ชจ๋ธ์์๋ง ์ ํจํฉ๋๋ค. | | |
| | `infer_method` | string | `"ode"` | ํ์ฐ ์ถ๋ก ๋ฐฉ๋ฒ: `"ode"` (Euler, ๋ ๋น ๋ฆ) ๋๋ `"sde"` (ํ๋ฅ ์ ). | | |
| | `timesteps` | string | null | ์ผํ๋ก ๊ตฌ๋ถ๋ ์ปค์คํ ํ์์คํ (์: `"0.97,0.76,0.615,0.5,0.395,0.28,0.18,0.085,0"`). `inference_steps`์ `shift`๋ฅผ ์ฌ์ ์ํฉ๋๋ค. | | |
| | `use_adg` | bool | `false` | ADG (Adaptive Dual Guidance) ์ฌ์ฉ (Base ๋ชจ๋ธ ์ ์ฉ) | | |
| | `cfg_interval_start` | float | `0.0` | CFG ์ ์ฉ ์์ ๋น์จ (0.0-1.0) | | |
| | `cfg_interval_end` | float | `1.0` | CFG ์ ์ฉ ์ข ๋ฃ ๋น์จ (0.0-1.0) | | |
| **5Hz LM ํ๋ผ๋ฏธํฐ (์ ํ ์ฌํญ, ์๋ฒ์ธก)**: | |
| ์ด ํ๋ผ๋ฏธํฐ๋ค์ ๋ฉํ๋ฐ์ดํฐ ์๋ ์์ฑ ๋ฐ (thinking=true์ผ ๋) ์ฝ๋ ์์ฑ์ ์ฌ์ฉ๋๋ 5Hz LM ์ํ๋ง์ ์ ์ดํฉ๋๋ค. | |
| | ํ๋ผ๋ฏธํฐ ๋ช | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช | | |
| | :--- | :--- | :--- | :--- | | |
| | `lm_model_path` | string | null | 5Hz LM ์ฒดํฌํฌ์ธํธ ๋๋ ํ ๋ฆฌ ์ด๋ฆ (์: `acestep-5Hz-lm-0.6B`) | | |
| | `lm_backend` | string | `"vllm"` | `vllm` ๋๋ `pt` | | |
| | `lm_temperature` | float | `0.85` | ์ํ๋ง ์จ๋ | | |
| | `lm_cfg_scale` | float | `2.5` | CFG ์ค์ผ์ผ (>1์ผ ๊ฒฝ์ฐ CFG ํ์ฑํ) | | |
| | `lm_negative_prompt` | string | `"NO USER INPUT"` | CFG์ ์ฌ์ฉ๋๋ ๋ค๊ฑฐํฐ๋ธ ํ๋กฌํํธ | | |
| | `lm_top_k` | int | null | Top-k (0/null์ ๋นํ์ฑ) | | |
| | `lm_top_p` | float | `0.9` | Top-p (>=1์ ๋นํ์ฑ) | | |
| | `lm_repetition_penalty` | float | `1.0` | ๋ฐ๋ณต ํ๋ํฐ | | |
| **LM CoT (Chain-of-Thought) ํ๋ผ๋ฏธํฐ**: | |
| | ํ๋ผ๋ฏธํฐ ๋ช | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช | | |
| | :--- | :--- | :--- | :--- | | |
| | `use_cot_caption` | bool | `true` | CoT ์ถ๋ก ์ ํตํด LM์ด ์ ๋ ฅ๋ ์บก์ ์ ๋ค์ ์ฐ๊ฑฐ๋ ๊ฐ์ ํ๋๋ก ํฉ๋๋ค. ๋ณ์นญ: `cot_caption`, `cot-caption` | | |
| | `use_cot_language` | bool | `true` | CoT๋ฅผ ํตํด LM์ด ๊ฐ์ฐฝ ์ธ์ด๋ฅผ ๊ฐ์งํ๋๋ก ํฉ๋๋ค. ๋ณ์นญ: `cot_language`, `cot-language` | | |
| | `constrained_decoding` | bool | `true` | ๊ตฌ์กฐํ๋ LM ์ถ๋ ฅ์ ์ํด FSM ๊ธฐ๋ฐ ์ ์ฝ ๋์ฝ๋ฉ์ ํ์ฑํํฉ๋๋ค. ๋ณ์นญ: `constrainedDecoding`, `constrained` | | |
| | `constrained_decoding_debug` | bool | `false` | ์ ์ฝ ๋์ฝ๋ฉ์ ๋ํ ๋๋ฒ๊ทธ ๋ก๊น ํ์ฑํ | | |
| | `allow_lm_batch` | bool | `true` | ํจ์จ์ฑ์ ์ํด LM ๋ฐฐ์น ์ฒ๋ฆฌ ํ์ฉ | | |
| **ํธ์ง/์ฐธ์กฐ ์ค๋์ค ํ๋ผ๋ฏธํฐ** (์๋ฒ์ ์ ๋ ๊ฒฝ๋ก ํ์): | |
| | ํ๋ผ๋ฏธํฐ ๋ช | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช | | |
| | :--- | :--- | :--- | :--- | | |
| | `reference_audio_path` | string | null | ์ฐธ์กฐ ์ค๋์ค ๊ฒฝ๋ก (Style Transfer) | | |
| | `src_audio_path` | string | null | ์์ค ์ค๋์ค ๊ฒฝ๋ก (Repainting/Cover) | | |
| | `task_type` | string | `"text2music"` | ์์ ์ ํ: `text2music`, `cover`, `repaint`, `lego`, `extract`, `complete` | | |
| | `instruction` | string | auto | ํธ์ง ์ง์นจ (์ ๊ณต๋์ง ์์ผ๋ฉด task_type์ ๋ฐ๋ผ ์๋ ์์ฑ๋จ) | | |
| | `repainting_start` | float | `0.0` | ๋ฆฌํ์ธํ ์์ ์๊ฐ (์ด) | | |
| | `repainting_end` | float | null | ๋ฆฌํ์ธํ ์ข ๋ฃ ์๊ฐ (์ด), ์ค๋์ค ๋๊น์ง์ ๊ฒฝ์ฐ -1 | | |
| | `audio_cover_strength` | float | `1.0` | ์ค๋์ค ์ปค๋ฒ ๊ฐ๋ (0.0-1.0). ์คํ์ผ ์ ์ก ์์ ์ ๊ฒฝ์ฐ ๋ฎ์ ๊ฐ(0.2)์ ์ค์ ํฉ๋๋ค. | | |
| #### ๋ฐฉ๋ฒ B: ํ์ผ ์ ๋ก๋ (multipart/form-data) | |
| ๋ก์ปฌ ์ค๋์ค ํ์ผ์ ์ฐธ์กฐ ๋๋ ์์ค ์ค๋์ค๋ก ์ ๋ก๋ํด์ผ ํ ๋ ์ฌ์ฉํฉ๋๋ค. | |
| ์์ ๋ชจ๋ ํ๋๋ฅผ ํผ ํ๋๋ก ์ง์ํ ๋ฟ๋ง ์๋๋ผ, ๋ค์ ํ์ผ ํ๋๋ ์ง์ํฉ๋๋ค: | |
| - `reference_audio` ๋๋ `ref_audio`: (ํ์ผ) ์ฐธ์กฐ ์ค๋์ค ํ์ผ ์ ๋ก๋ | |
| - `src_audio` ๋๋ `ctx_audio`: (ํ์ผ) ์์ค ์ค๋์ค ํ์ผ ์ ๋ก๋ | |
| > **์ฐธ๊ณ **: ํ์ผ์ ์ ๋ก๋ํ๋ฉด ํด๋น `_path` ํ๋ผ๋ฏธํฐ๋ ์๋์ผ๋ก ๋ฌด์๋๊ณ ์์คํ ์ ์ ๋ก๋ ํ ์์ฑ๋ ์์ ํ์ผ ๊ฒฝ๋ก๋ฅผ ์ฌ์ฉํฉ๋๋ค. | |
| ### 4.3 ์๋ต ์์ | |
| ```json | |
| { | |
| "data": { | |
| "task_id": "550e8400-e29b-41d4-a716-446655440000", | |
| "status": "queued", | |
| "queue_position": 1 | |
| }, | |
| "code": 200, | |
| "error": null, | |
| "timestamp": 1700000000000, | |
| "extra": null | |
| } | |
| ``` | |
| --- | |
| ## 5. ์์ ๊ฒฐ๊ณผ ๋ฐฐ์น ์กฐํ | |
| ### 5.1 API ์ ์ | |
| - **URL**: `/query_result` | |
| - **Method**: `POST` | |
| - **Content-Type**: `application/json` ๋๋ `application/x-www-form-urlencoded` | |
| ### 5.2 ์์ฒญ ํ๋ผ๋ฏธํฐ | |
| | ํ๋ผ๋ฏธํฐ ๋ช | ํ์ | ์ค๋ช | | |
| | :--- | :--- | :--- | | |
| | `task_id_list` | string (JSON array) or array | ์กฐํํ ์์ ID ๋ชฉ๋ก | | |
| ### 5.3 ์๋ต ์์ | |
| ```json | |
| { | |
| "data": [ | |
| { | |
| "task_id": "550e8400-e29b-41d4-a716-446655440000", | |
| "status": 1, | |
| "result": "[{\"file\": \"/v1/audio?path=...\", \"wave\": \"\", \"status\": 1, \"create_time\": 1700000000, \"env\": \"development\", \"prompt\": \"upbeat pop song\", \"lyrics\": \"Hello world\", \"metas\": {\"bpm\": 120, \"duration\": 30, \"genres\": \"\", \"keyscale\": \"C Major\", \"timesignature\": \"4\"}, \"generation_info\": \"...\", \"seed_value\": \"12345,67890\", \"lm_model\": \"acestep-5Hz-lm-0.6B\", \"dit_model\": \"acestep-v15-turbo\"}]" | |
| } | |
| ], | |
| "code": 200, | |
| "error": null, | |
| "timestamp": 1700000000000, | |
| "extra": null | |
| } | |
| ``` | |
| **Result ํ๋ ์ค๋ช ** (result๋ JSON ๋ฌธ์์ด์ด๋ฉฐ, ํ์ฑ ํ ๋ค์์ ํฌํจ): | |
| | ํ๋ | ํ์ | ์ค๋ช | | |
| | :--- | :--- | :--- | | |
| | `file` | string | ์ค๋์ค ํ์ผ URL (`/v1/audio` ์๋ํฌ์ธํธ์ ํจ๊ป ์ฌ์ฉ) | | |
| | `wave` | string | ํํ ๋ฐ์ดํฐ (๋ณดํต ๋น์ด ์์) | | |
| | `status` | int | ์ํ ์ฝ๋ (0=์งํ ์ค, 1=์ฑ๊ณต, 2=์คํจ) | | |
| | `create_time` | int | ์์ฑ ์๊ฐ (Unix ํ์์คํฌํ) | | |
| | `env` | string | ํ๊ฒฝ ์๋ณ์ | | |
| | `prompt` | string | ์ฌ์ฉ๋ ํ๋กฌํํธ | | |
| | `lyrics` | string | ์ฌ์ฉ๋ ๊ฐ์ฌ | | |
| | `metas` | object | ๋ฉํ๋ฐ์ดํฐ (bpm, duration, genres, keyscale, timesignature) | | |
| | `generation_info` | string | ์์ฑ ์ ๋ณด ์์ฝ | | |
| | `seed_value` | string | ์ฌ์ฉ๋ ์๋ ๊ฐ (์ผํ๋ก ๊ตฌ๋ถ) | | |
| | `lm_model` | string | ์ฌ์ฉ๋ LM ๋ชจ๋ธ ๋ช | | |
| | `dit_model` | string | ์ฌ์ฉ๋ DiT ๋ชจ๋ธ ๋ช | | |
| --- | |
| ## 6. ์ ๋ ฅ ํฌ๋งทํ (Format Input) | |
| ### 6.1 API ์ ์ | |
| - **URL**: `/format_input` | |
| - **Method**: `POST` | |
| ์ด ์๋ํฌ์ธํธ๋ LLM์ ์ฌ์ฉํ์ฌ ์ฌ์ฉ์๊ฐ ์ ๊ณตํ ์บก์ ๊ณผ ๊ฐ์ฌ๋ฅผ ๊ฐ์ ํ๊ณ ํฌ๋งทํ ํฉ๋๋ค. | |
| ### 6.2 ์์ฒญ ํ๋ผ๋ฏธํฐ | |
| | ํ๋ผ๋ฏธํฐ ๋ช | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช | | |
| | :--- | :--- | :--- | :--- | | |
| | `prompt` | string | `""` | ์์ ์ค๋ช ํ๋กฌํํธ | | |
| | `lyrics` | string | `""` | ๊ฐ์ฌ ๋ด์ฉ | | |
| | `temperature` | float | `0.85` | LM ์ํ๋ง ์จ๋ | | |
| | `param_obj` | string (JSON) | `"{}"` | ๋ฉํ๋ฐ์ดํฐ๋ฅผ ํฌํจํ๋ JSON ๊ฐ์ฒด (duration, bpm, key, time_signature, language) | | |
| ### 6.3 ์๋ต ์์ | |
| ```json | |
| { | |
| "data": { | |
| "caption": "Enhanced music description", | |
| "lyrics": "Formatted lyrics...", | |
| "bpm": 120, | |
| "key_scale": "C Major", | |
| "time_signature": "4", | |
| "duration": 180, | |
| "vocal_language": "en" | |
| }, | |
| "code": 200, | |
| "error": null, | |
| "timestamp": 1700000000000, | |
| "extra": null | |
| } | |
| ``` | |
| --- | |
| ## 7. ๋๋ค ์ํ ๊ฐ์ ธ์ค๊ธฐ | |
| ### 7.1 API ์ ์ | |
| - **URL**: `/create_random_sample` | |
| - **Method**: `POST` | |
| ์ด ์๋ํฌ์ธํธ๋ ํผ ์ฑ์ฐ๊ธฐ๋ฅผ ์ํด ์ฌ์ ๋ก๋๋ ์์ ๋ฐ์ดํฐ์์ ์์์ ์ํ ํ๋ผ๋ฏธํฐ๋ฅผ ๋ฐํํฉ๋๋ค. | |
| ### 7.2 ์์ฒญ ํ๋ผ๋ฏธํฐ | |
| | ํ๋ผ๋ฏธํฐ ๋ช | ํ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช | | |
| | :--- | :--- | :--- | :--- | | |
| | `sample_type` | string | `"simple_mode"` | ์ํ ์ ํ: `"simple_mode"` ๋๋ `"custom_mode"` | | |
| --- | |
| ## 8. ์ฌ์ฉ ๊ฐ๋ฅํ ๋ชจ๋ธ ๋ชฉ๋ก | |
| ### 8.1 API ์ ์ | |
| - **URL**: `/v1/models` | |
| - **Method**: `GET` | |
| ์๋ฒ์ ๋ก๋๋ ์ฌ์ฉ ๊ฐ๋ฅํ DiT ๋ชจ๋ธ ๋ชฉ๋ก์ ๋ฐํํฉ๋๋ค. | |
| ### 8.2 ์๋ต ์์ | |
| ```json | |
| { | |
| "data": { | |
| "models": [ | |
| { | |
| "name": "acestep-v15-turbo", | |
| "is_default": true | |
| }, | |
| { | |
| "name": "acestep-v15-turbo-shift3", | |
| "is_default": false | |
| } | |
| ], | |
| "default_model": "acestep-v15-turbo" | |
| }, | |
| "code": 200, | |
| "error": null, | |
| "timestamp": 1700000000000, | |
| "extra": null | |
| } | |
| ``` | |
| --- | |
| ## 9. ์๋ฒ ํต๊ณ | |
| ### 9.1 API ์ ์ | |
| - **URL**: `/v1/stats` | |
| - **Method**: `GET` | |
| ์๋ฒ ๋ฐํ์ ํต๊ณ๋ฅผ ๋ฐํํฉ๋๋ค. | |
| --- | |
| ## 10. ์ค๋์ค ํ์ผ ๋ค์ด๋ก๋ | |
| ### 10.1 API ์ ์ | |
| - **URL**: `/v1/audio` | |
| - **Method**: `GET` | |
| ๊ฒฝ๋ก๋ณ๋ก ์์ฑ๋ ์ค๋์ค ํ์ผ์ ๋ค์ด๋ก๋ํฉ๋๋ค. | |
| ### 10.2 ์์ฒญ ํ๋ผ๋ฏธํฐ | |
| | ํ๋ผ๋ฏธํฐ ๋ช | ํ์ | ์ค๋ช | | |
| | :--- | :--- | :--- | | |
| | `path` | string | ์ค๋์ค ํ์ผ์ URL ์ธ์ฝ๋ฉ๋ ๊ฒฝ๋ก | | |
| --- | |
| ## 11. ํฌ์ค ์ฒดํฌ | |
| ### 11.1 API ์ ์ | |
| - **URL**: `/health` | |
| - **Method**: `GET` | |
| ์๋น์ค ์ํ๋ฅผ ๋ฐํํฉ๋๋ค. | |
| --- | |
| ## 12. ํ๊ฒฝ ๋ณ์ | |
| API ์๋ฒ๋ ํ๊ฒฝ ๋ณ์๋ฅผ ์ฌ์ฉํ์ฌ ๊ตฌ์ฑํ ์ ์์ต๋๋ค: | |
| ### ์๋ฒ ๊ตฌ์ฑ | |
| | ๋ณ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช | | |
| | :--- | :--- | :--- | | |
| | `ACESTEP_API_HOST` | `127.0.0.1` | ์๋ฒ ๋ฐ์ธ๋ ํธ์คํธ | | |
| | `ACESTEP_API_PORT` | `8001` | ์๋ฒ ๋ฐ์ธ๋ ํฌํธ | | |
| | `ACESTEP_API_KEY` | (๋น์ด ์์) | API ์ธ์ฆ ํค (๋น์ด ์์ผ๋ฉด ์ธ์ฆ ๋นํ์ฑํ) | | |
| | `ACESTEP_API_WORKERS` | `1` | API ์์ปค ์ค๋ ๋ ์ | | |
| ### ๋ชจ๋ธ ๊ตฌ์ฑ | |
| | ๋ณ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช | | |
| | :--- | :--- | :--- | | |
| | `ACESTEP_CONFIG_PATH` | `acestep-v15-turbo` | ์ฃผ DiT ๋ชจ๋ธ ๊ฒฝ๋ก | | |
| | `ACESTEP_DEVICE` | `auto` | ๋ชจ๋ธ ๋ก๋ฉ ์ฅ์น | | |
| | `ACESTEP_OFFLOAD_TO_CPU` | `false` | ์ ํด ์ ๋ชจ๋ธ์ CPU๋ก ์คํ๋ก๋ | | |
| ### LM ๊ตฌ์ฑ | |
| | ๋ณ์ | ๊ธฐ๋ณธ๊ฐ | ์ค๋ช | | |
| | :--- | :--- | :--- | | |
| | `ACESTEP_INIT_LLM` | auto | ์์ ์ LM์ ์ด๊ธฐํํ ์ง ์ฌ๋ถ (GPU์ ๋ฐ๋ผ ์๋ ๊ฒฐ์ ) | | |
| | `ACESTEP_LM_MODEL_PATH` | `acestep-5Hz-lm-0.6B` | ๊ธฐ๋ณธ 5Hz LM ๋ชจ๋ธ | | |
| | `ACESTEP_LM_BACKEND` | `vllm` | LM ๋ฐฑ์๋ (vllm ๋๋ pt) | | |
| --- | |
| ## ์๋ฌ ์ฒ๋ฆฌ | |
| **HTTP ์ํ ์ฝ๋**: | |
| - `200`: ์ฑ๊ณต | |
| - `400`: ์๋ชป๋ ์์ฒญ (์๋ชป๋ JSON, ๋๋ฝ๋ ํ๋) | |
| - `401`: ๋ฏธ์ธ์ฆ (๋๋ฝ๋์๊ฑฐ๋ ์๋ชป๋ API ํค) | |
| - `429`: ์๋ฒ ๋ฐ์จ (๋๊ธฐ์ด์ด ๊ฐ๋ ์ฐธ) | |
| - `500`: ๋ด๋ถ ์๋ฒ ์ค๋ฅ | |
| --- | |
| ## ๋ชจ๋ฒ ์ฌ๋ก | |
| 1. **`thinking=true`๋ฅผ ์ฌ์ฉ**ํ์ฌ LM์ด ํฅ์๋ ์์ฑ ํ์ง์ ๊ฒฐ๊ณผ๋ฅผ ์ป์ผ์ธ์. | |
| 2. ์์ฐ์ด ์ค๋ช ์์ ๋น ๋ฅธ ์์ฑ์ ์ํด **`sample_query`/`description`์ ์ฌ์ฉ**ํ์ธ์. | |
| 3. ์บก์ /๊ฐ์ฌ๊ฐ ์์ง๋ง LM์ด ์ด๋ฅผ ๊ฐ์ ํ๊ธฐ๋ฅผ ์ํ ๋ **`use_format=true`๋ฅผ ์ฌ์ฉ**ํ์ธ์. | |
| 4. `/query_result` ์๋ํฌ์ธํธ๋ฅผ ์ฌ์ฉํ์ฌ ์ฌ๋ฌ ์์ ์ํ๋ฅผ **๋ฐฐ์น ์กฐํ**ํ์ธ์. | |
| 5. **/v1/stats๋ฅผ ํ์ธ**ํ์ฌ ์๋ฒ ๋ถํ์ ํ๊ท ์์ ์๊ฐ์ ํ์ ํ์ธ์. | |
| 6. **๋ณด์์ ์ํด** `ACESTEP_API_KEY`๋ฅผ ์ค์ ํ์ฌ ์ธ์ฆ์ ํ์ฑํํ์ธ์. | |