ACE-Step 1.5XL 基礎版:文字轉音樂
使用40億參數ACE-Step 1.5 XL模型,從文字提示產生高品質音訊。
工作流程內部
來源範本的唯讀預覽。請在 Cloud 中開啟,以探索節點並進行變更。
從您的程式碼呼叫此模型
以下請求使用與 Playground 相同的已準備節點圖和設定。每次提交都可能啟動付費執行;若提交結果不明,請勿自動重試提交。
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
需要付費 Cloud 方案與點數。
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"3": {
"class_type": "KSampler",
"inputs": {
"cfg": 6,
"denoise": 1,
"latent_image": [
"98",
0
],
"model": [
"78",
0
],
"negative": [
"47",
0
],
"positive": [
"94",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": [
"109",
0
],
"steps": 50
},
"_meta": {
"title": "KSampler"
}
},
"18": {
"class_type": "VAEDecodeAudio",
"inputs": {
"samples": [
"3",
0
],
"vae": [
"106",
0
]
},
"_meta": {
"title": "VAE Decode Audio"
}
},
"47": {
"class_type": "ConditioningZeroOut",
"inputs": {
"conditioning": [
"94",
0
]
},
"_meta": {
"title": "Conditioning Zero Out"
}
},
"78": {
"class_type": "ModelSamplingAuraFlow",
"inputs": {
"model": [
"104",
0
],
"sampling": "flow",
"shift": 3
},
"_meta": {
"title": "ModelSamplingAuraFlow"
}
},
"94": {
"class_type": "TextEncodeAceStepAudio1.5",
"inputs": {
"bpm": 102,
"cfg_scale": 2,
"clip": [
"105",
0
],
"duration": 120,
"generate_audio_codes": True,
"keyscale": "G major",
"language": "en",
"lyrics": "\n[Intro - fingerpicked guitar, banjo rolls]\n\n[Verse 1]\nMorning fog lies on the river bend\nLantern's low and the night's at its end\nMama's kettle singing on the stove\nI'll be leaving down the old dirt road\n\n[Verse 2]\nTie my boots and I button my coat\nCarry nothing but a song and a note\nEvery hollow knows my daddy's name\nEvery hill will call me back again\n\n[Chorus - full band, three-part harmony]\nOh, carry me home on the evening train\nOver the mountain and through the rain\nWherever I wander, wherever I roam\nThe river will carry me home\n\n[Instrumental - banjo and pump organ]\n\n[Chorus]\nOh, carry me home on the evening train\nOver the mountain and through the rain\nWherever I wander, wherever I roam\nThe river will carry me home\n\n[Outro - harmonies hold, guitar alone]\n",
"min_p": 0,
"seed": [
"109",
0
],
"tags": "1960s Appalachian acoustic folk revival, 102 BPM in G major. Mood transitions from intimate solitude to communal warmth, tracked with vintage analog tape warmth and room bleed. Instrumentation features open-tuned mahogany acoustic guitar, clawhammer banjo, upright bass, brushed snare, and pump organ. Arrangement: Intro begins sparse with rhythmic fingerpicked guitar and quiet banjo rolls. Verse features an unadorned, earthy female alto lead singing close-mic’d narrative English lyrics over subtle plucked upright bass. Chorus builds dynamically into a full, resonant crescendo with soaring three-part English vocal harmonies, sustained harmonium chords, and light brushed percussion. Outro holds the ringing choral harmony before decaying into fingerpicked acoustic guitar sustain.",
"temperature": 0.85,
"timesignature": "4",
"top_k": 0,
"top_p": 0.9
},
"_meta": {
"title": "TextEncodeAceStepAudio1.5"
}
},
"98": {
"class_type": "EmptyAceStep1.5LatentAudio",
"inputs": {
"batch_size": 1,
"seconds": 120
},
"_meta": {
"title": "Empty Ace Step 1.5 Latent Audio"
}
},
"104": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "acestep_v1.5_xl_base_bf16.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"105": {
"class_type": "DualCLIPLoader",
"inputs": {
"clip_name1": "qwen_0.6b_ace15.safetensors",
"clip_name2": "qwen_4b_ace15.safetensors",
"device": "default",
"type": "ace"
},
"_meta": {
"title": "Load CLIP (Dual)"
}
},
"106": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "ace_1.5_vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"107": {
"class_type": "SaveAudioMP3",
"inputs": {
"audio": [
"18",
0
],
"filename_prefix": "audio/ace_step1.5_xl_base",
"quality": "V0"
},
"_meta": {
"title": "Save Audio (MP3) (DEPRECATED)"
}
},
"109": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 0
},
"_meta": {
"title": "Int"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)
for output in job.get_outputs("107"):
output.to_file(output.name)試試範例
關於此工作流程
本流程可將文字提示轉換為音樂,採用 ACE-Step 1.5 XL Base(4B)模型於 ComfyUI。流程結合 UNETLoader 與 acestep_v1.5_xl_base_bf16.safetensors 擴散模型,以及 VAELoader 與 ace_1.5_vae.safetensors 解碼器。你的提示詞由 TextEncodeAceStepAudio1.5 編碼,EmptyAceStep1.5LatentAudio 節點根據你設定的長度建立空白潛在音訊片段,KSampler 節點則進行去噪合成音樂。VAEDecodeAudio 會將潛在音訊還原為波形,SaveAudioMP3 將最終音軌寫入磁碟。
技術細節方面,ConditioningZeroOut 可在負面提示為空時提供穩定 fallback,ModelSamplingAuraFlow 則設定模型的取樣排程,確保 KSampler 能產生穩定且風格一致的結果。PrimitiveNode 與 PrimitiveInt 節點提供長度、步數、引導(CFG)與種子等簡易控制。流程分為模型、長度、提示三大區塊,方便你快速載入權重、設定片段長度、輸入提示詞,並透過調整步數、CFG 與種子快速反覆試驗。
問答
片段長度在 EmptyAceStep1.5LatentAudio 設定(通常由 PrimitiveInt 控制秒數)。長度越長,VRAM 與運算時間需求越高。如遇記憶體不足,請縮短長度、步數或批次大小。
建議起始設定為 30–60 步、CFG 3–6、denoise 1.0。請保持 ModelSamplingAuraFlow 連接模型,確保取樣排程正確。增加步數可提升細節,CFG 適中可避免雜訊。
請使用明確、風格明顯的提示(如曲風、樂器、情緒、節奏)。CFG 保持適中,嘗試不同種子,並略微提高步數。可用簡短負面提示(如「無失真、無爆音」);ConditioningZeroOut 可安全處理空白負面提示。
SaveAudioMP3 會將 MP3 存到 ComfyUI 輸出資料夾。如需 WAV 格式,可在 VAEDecodeAudio 後加裝支援 WAV 的儲存節點並連接。