Skip to content

Command-Line Interface

Applio provides a command-line interface through core.py that allows you to perform all major operations without the Gradio web UI. This is useful for automation, headless servers, cloud environments, and advanced scripting.

The web server (app.py) also accepts a number of startup arguments — see Application Server Arguments below.

Terminal window
python core.py <command> [options]
python app.py [options]
OptionDescription
-h, --helpShow help message and exit

Convert a single audio file using a voice model.

Terminal window
python core.py infer --input_path <audio> --output_path <output> --pth_path <model> [options]

Required Arguments:

OptionDescription
--input_pathPath to the input audio file
--output_pathPath to save the converted audio
--pth_pathPath to the model .pth file
--index_pathPath to the .index file

Pitch & Voice Arguments:

OptionTypeDefaultDescription
--pitchint (-24..24)0Pitch adjustment in semitones
--index_ratefloat (0..1)0.75Search feature ratio — how much the index influences output
--volume_envelopefloat (0..1)1RMS mix rate — blends output volume with original
--protectfloat (0..0.5)0.5Protect voiceless consonants and breathing sounds
--f0_methodstr"rmvpe"Pitch extraction method (crepe, crepe-tiny, rmvpe, fcpe, hybrid)
--sidint0Speaker ID for multi-speaker models

Processing Arguments:

OptionTypeDefaultDescription
--split_audioboolFalseSplit long audio into segments for processing
--f0_autotuneboolFalseApply autotune to the output pitch
--f0_autotune_strengthfloat (0..1)1.0Autotune intensity
--proposed_pitchboolFalseEnable proposed pitch correction
--proposed_pitch_thresholdfloat (50..1200)155.0Threshold for proposed pitch
--clean_audioboolFalseApply noise reduction to the output
--clean_strengthfloat (0..1)0.7Noise reduction intensity
--export_formatstr"WAV"Output format (WAV, MP3, FLAC, OGG, M4A)
--embedder_modelstr"contentvec"Embedder model (contentvec, spin, spin-v2, chinese-hubert, japanese-hubert, korean-hubert, custom)
--embedder_model_customstrNoneHuggingFace model ID when embedder_model is custom
--formant_shiftingboolFalseEnable formant shifting
--formant_qfrencyfloat1.0Formant shift quefrency
--formant_timbrefloat1.0Formant shift timbre
--post_processboolFalseEnable post-processing effects chain

Post-Processing Effects:

Each effect has a boolean toggle and one or more parameter flags. Set the toggle to enable the effect, then configure it with the parameter flags.

Effect ToggleParameter FlagsDefaults
--reverb--reverb_room_size --reverb_damping --reverb_wet_gain --reverb_dry_gain --reverb_width --reverb_freeze_mode0.5 each
--pitch_shift--pitch_shift_semitones0.0
--limiter--limiter_threshold --limiter_release_time-6 / 0.01
--gain--gain_db0.0
--distortion--distortion_gain25
--chorus--chorus_rate --chorus_depth --chorus_center_delay --chorus_feedback --chorus_mix1.0 / 0.25 / 7 / 0.0 / 0.5
--bitcrush--bitcrush_bit_depth8
--clipping--clipping_threshold-6
--compressor--compressor_threshold --compressor_ratio --compressor_attack --compressor_release0 / 1 / 1.0 / 100
--delay--delay_seconds --delay_feedback --delay_mix0.5 / 0.0 / 0.5

Convert multiple audio files in a directory.

Terminal window
python core.py batch_infer --input_folder <folder> --output_folder <folder> --pth_path <model> [options]
OptionAliasDescriptionDefault
--input_folderPath to folder containing input audio filesRequired
--output_folderPath to folder for output filesRequired
--pth_pathPath to the model .pth fileRequired
--index_pathPath to the .index fileRequired
All inference optionsSame as infer commandSame as infer

Generate speech from text using Edge TTS, optionally passing through voice conversion.

Terminal window
python core.py tts --tts_text <text> --tts_voice <voice> --output_tts_path <file> --output_rvc_path <file> --pth_path <model> [options]
OptionTypeDefaultDescription
--tts_textstrRequiredText to synthesize
--tts_filestrNonePath to a .txt file with the text
--tts_voicestrRequiredTTS voice name
--tts_rateint (-100..100)0Speech rate adjustment
--output_tts_pathstrRequiredPath to save the raw TTS audio
--output_rvc_pathstrRequiredPath to save the voice-converted audio
--pth_pathstrRequiredPath to voice model .pth
--index_pathstrRequiredPath to .index file
--pitchint (-24..24)0Pitch adjustment
--index_ratefloat (0..1)0.3Search feature ratio
--volume_envelopefloat (0..1)1RMS mix rate
--protectfloat (0..0.5)0.33Protect voiceless consonants
--f0_methodstr"rmvpe"Pitch extraction method
--split_audioboolFalseSplit audio for processing
--f0_autotuneboolFalseEnable autotune
--f0_autotune_strengthfloat (0..1)1.0Autotune strength
--proposed_pitchboolFalseProposed pitch correction
--proposed_pitch_thresholdfloat (100..500)155.0Pitch threshold
--clean_audioboolFalseEnable noise reduction
--clean_strengthfloat (0..1)0.7Noise reduction strength
--export_formatstr"WAV"Output format
--embedder_modelstr"contentvec"Embedder model
--embedder_model_customstrNoneCustom HuggingFace embedder

Preprocess a dataset for training. Slices audio, removes silence, applies noise reduction, and resamples.

Terminal window
python core.py preprocess --model_name <name> --dataset_path <path> --sample_rate <rate> [options]
OptionTypeDefaultDescription
--model_namestrRequiredName for the model
--dataset_pathstrRequiredPath to the dataset folder
--sample_rateintRequiredTarget sample rate (32000, 40000, 48000)
--cpu_coresintNoneNumber of CPU threads to use
--cut_preprocessstr"Automatic"Slicing method (Skip, Simple, Automatic)
--process_effectsboolFalseApply audio effects during preprocessing
--noise_reductionboolFalseApply noise reduction
--noise_reduction_strengthfloat (0..1)0.7Noise reduction intensity
--chunk_lenfloat (0.5..5)3.0Slice length in seconds
--overlap_lenfloat (0..0.4)0.3Overlap between slices
--normalization_modestr"none"Peak normalization (none, pre, post)

Extract features (F0 and embeddings) from a preprocessed dataset.

Terminal window
python core.py extract --model_name <name> --sample_rate <rate> [options]
OptionTypeDefaultDescription
--model_namestrRequiredName of the model
--sample_rateintRequiredSample rate (32000, 40000, 44100, 48000)
--f0_methodstr"rmvpe"Pitch extraction method
--embedder_modelstr"contentvec"Embedder model
--embedder_model_customstrNoneCustom HuggingFace embedder
--cpu_coresintNoneCPU threads
--gpustr"-"GPU index to use (e.g. "0")
--include_mutesint (0..10)2Number of mute frames to include

Train a voice model.

Terminal window
python core.py train --model_name <name> --sample_rate <rate> [options]
OptionTypeDefaultDescription
--model_namestrRequiredName of the model
--sample_rateintRequiredSample rate (32000, 40000, 48000)
--vocoderstr"HiFi-GAN"Vocoder type (HiFi-GAN, MRF HiFi-GAN, RefineGAN)
--total_epochint (1..10000)1000Total training epochs
--save_every_epochint (1..100)RequiredSave checkpoint every N epochs
--batch_sizeint (1..50)8Training batch size
--gpustr"0"GPU index for training
--pretrainedboolTrueUse default pre-trained model
--custom_pretrainedboolFalseUse a custom pre-trained model
--g_pretrained_pathstrNonePath to custom pre-trained generator
--d_pretrained_pathstrNonePath to custom pre-trained discriminator
--index_algorithmstr"Auto"Index algorithm (Auto, Faiss, KMeans)
--checkpointingboolFalseEnable gradient checkpointing to save VRAM
--save_only_latestboolFalseOnly keep the latest checkpoint
--save_every_weightsboolTrueSave model weights at every checkpoint
--cleanupboolFalseClean up temporary files after training
--cache_data_in_gpuboolFalseCache training data in GPU memory

Generate a FAISS or KMeans index from extracted features.

Terminal window
python core.py index --model_name <name>
OptionTypeDefaultDescription
--model_namestrRequiredName of the trained model
--index_algorithmstr"Auto"Index algorithm (Auto, Faiss, KMeans)

Display metadata about a trained model.

Terminal window
python core.py model_information --pth_path <path>
OptionTypeDescription
--pth_pathstrPath to the .pth model file (Required)

Output includes: version, sample rate, whether F0 was used, embedder name, epoch count, step count.

Blend two model weights into a new model using linear interpolation.

Terminal window
python core.py model_blender --model_name <name> --pth_path_1 <model_a> --pth_path_2 <model_b> [options]
OptionTypeDefaultDescription
--model_namestrRequiredName for the blended model
--pth_path_1strRequiredPath to first model .pth
--pth_path_2strRequiredPath to second model .pth
--ratiofloat (0..1)0.5Blend ratio (0 = all model A, 1 = all model B)

Launch TensorBoard for monitoring training progress.

Terminal window
python core.py tensorboard

No arguments.


Download a model from a URL (HuggingFace, Google Drive, or direct link).

Terminal window
python core.py download --model_link <url>
OptionTypeDescription
--model_linkstrDownload URL for the model (Required)

Download and install required prerequisites (pretrained models, predictors, embedders).

Terminal window
python core.py prerequisites [options]
OptionTypeDefaultDescription
--pretraineds_hifiganboolTrueDownload pre-trained HiFi-GAN models
--modelsboolTrueDownload predictor models
--exeboolTrueDownload bundled executables (ffmpeg, etc.)

Analyze an audio file and display spectral information.

Terminal window
python core.py audio_analyzer --input_path <audio>
OptionTypeDescription
--input_pathstrPath to the audio file to analyze (Required)

These arguments are passed to app.py when starting the web interface:

Terminal window
python app.py [options]
OptionDescription
--shareGenerate a public Gradio share URL (e.g., https://xxxxx.gradio.live)
--port <num>Specify the server port (default: 6969)
--server-name <host>Bind to a specific host address (default: 127.0.0.1)
--openAutomatically open the browser on launch
--clientEnable realtime client mode (mounts FastAPI endpoint and injects audio client JS)

Port conflict handling: If the specified port is already in use, Applio automatically decrements the port number and retries until it finds an available port.


Basic inference with a model:

Terminal window
python core.py infer --input_path my_speech.wav --output_path converted.wav --pth_path logs/MyModel/G_1234.pth --index_path logs/MyModel/MyModel.index

Inference with pitch adjustment and CREPE:

Terminal window
python core.py infer --input_path input.wav --output_path output.wav --pth_path logs/MyModel/G_1000.pth --index_path logs/MyModel/MyModel.index --pitch -3 --f0_method crepe --embedder_model contentvec

Batch inference:

Terminal window
python core.py batch_infer --input_folder ./input --output_folder ./output --pth_path logs/MyModel/G_1234.pth --index_path logs/MyModel/MyModel.index

Full training pipeline:

Terminal window
python core.py preprocess --model_name MyVoice --dataset_path assets/datasets/MyVoice --sample_rate 40000
python core.py extract --model_name MyVoice --sample_rate 40000 --f0_method rmvpe --embedder_model contentvec
python core.py train --model_name MyVoice --sample_rate 40000 --f0_method rmvpe --embedder_model contentvec --batch_size 8 --save_every_epoch 50 --total_epoch 300
python core.py index --model_name MyVoice

TTS with voice conversion:

Terminal window
python core.py tts --tts_text "Hello, this is a test." --tts_voice "en-US-JennyNeural" --output_tts_path tts_output.wav --output_rvc_path converted.wav --pth_path logs/MyModel/G_1234.pth --index_path logs/MyModel/MyModel.index

Blend two models:

Terminal window
python core.py model_blender --model_name Blended --pth_path_1 logs/ModelA/G_100.pth --pth_path_2 logs/ModelB/G_200.pth --ratio 0.6

Inspect model metadata:

Terminal window
python core.py model_information --pth_path logs/MyModel/G_1234.pth

Start the web UI with a public share link:

Terminal window
python app.py --share --port 7860