Files

67 lines
2.5 KiB
Markdown

# ComfyUI-MiMoASR CLI
Drives the `MiMoASRLoader` + `MiMoASRTranscribe` nodes over ComfyUI's HTTP +
WebSocket API. Same `ComfyClient` template used across the other
`ComfyUI-*` packages.
## Quick start
```bash
# uv handles dependencies via the PEP 723 inline script metadata
uv run python mimo_asr_cli.py /path/to/speech.wav --ip 10.8.0.12
# Explicit Chinese tag (useful for accented or noisy speech)
uv run python mimo_asr_cli.py speech.wav --language Chinese --ip 10.8.0.12
# Pass model + repo paths if your ComfyUI server can't see the defaults
uv run python mimo_asr_cli.py speech.wav \
--model-path /mnt/models/MiMo-V2.5-ASR \
--tokenizer-path /mnt/models/MiMo-Audio-Tokenizer \
--repo-path /mnt/repos/MiMo-V2.5-ASR \
--ip 10.8.0.12
# Save transcript to file
uv run python mimo_asr_cli.py speech.wav --out transcript.txt --ip 10.8.0.12
```
## Flags
| Flag | Default | Notes |
|---|---|---|
| `audio` (positional) | — | Local audio file. Uploaded to ComfyUI's `input/`. |
| `--ip` | `127.0.0.1` | ComfyUI host. |
| `--port` | `8188` | ComfyUI port. |
| `--server` | — | Full `host:port`, overrides `--ip`/`--port`. |
| `--out` | — | Write transcript to file. |
| `--model-path` | `./models/MiMo-V2.5-ASR` | Relative to ComfyUI cwd, or absolute. |
| `--tokenizer-path` | `./models/MiMo-Audio-Tokenizer` | Same. |
| `--repo-path` | (env `MIMO_ASR_REPO`) | Local clone of [XiaomiMiMo/MiMo-V2.5-ASR](https://github.com/XiaomiMiMo/MiMo-V2.5-ASR). |
| `--language` | `Auto` | `Auto` / `Chinese` / `English`. |
| `--dump-workflow PATH` | — | Save the API-format JSON for inspection. |
| `--no-run` | off | Combine with `--dump-workflow` to skip submission. |
| `--timeout` | `600` | Seconds. |
## Server-side checklist
```bash
# 1. ComfyUI is up
curl -s -o /dev/null -w "HTTP %{http_code}\n" http://SERVER:8188/
# 2. Nodes loaded
curl -s http://SERVER:8188/object_info | python3 -c "
import json, sys
d = json.load(sys.stdin)
for n in ('MiMoASRLoader', 'MiMoASRTranscribe', 'LoadAudio', 'PreviewAny'):
print(f' {n}: {\"✓\" if n in d else \"✗\"}')"
```
`PreviewAny` ships with `rgthree-comfy` (and several others). If it's not
installed, swap the `preview` node in `build_workflow()` for whatever your
environment provides — `ShowText|pysssss` is a drop-in replacement.
## Audio format notes
`/upload/image` accepts any file (the endpoint's name is misleading). Audio
gets stored under ComfyUI's `input/` folder, and `LoadAudio` handles
decoding via torchaudio — so wav / mp3 / flac / m4a / ogg all work.