Drush commands¶
Every command has an aift-* alias (ai-finetuner:list is also aift-list). Drush runs as the
anonymous user, so an entity display source that queries by bundle only sees published, publicly
visible entities. Pass explicit ids (--ids) to load specific entities regardless of access.
Providers¶
drush ai-finetuner:providers
Lists every discovered plugin with its label, whether it is usable, the dataset types it accepts
and its base models. Add --fields=id,label,usable,dataset_types,base_models,training_types to see
training types too, or --format=json for machine readable output.
Jobs¶
drush ai-finetuner:list
drush ai-finetuner:list --status=running
Lists jobs with id, name, provider, base model, source, status and result id. --status accepts
draft, pending, running, completed, failed or cancelled.
Create¶
drush ai-finetuner:create "Name" [options]
Creates a job in draft, builds the dataset once and prints its size. Options:
| Option | Meaning |
|---|---|
--plugin |
Plugin id from ai-finetuner:providers. Defaults to the first usable plugin. |
--dataset-type |
image (default) or text. |
--base-model |
Base model id. Defaults to the plugin's first model. |
--training-type |
Training type id, if the plugin has any. Defaults to the first. |
--trigger-word |
Trigger word. |
--settings |
Plugin settings as JSON, for example '{"max_train_steps":500}'. |
--start |
Start the training right after creating the job. |
Exactly one dataset source:
| Source | Options |
|---|---|
| Upload | --images=a.jpg,b.jpg,42: comma separated local paths, stream URIs or file ids. Local files are copied into ai-finetune/YYYY-MM as managed files. |
| Entity display | --entity-type=node plus optional --bundle, --view-mode (default ai_finetuner), --ids and --limit (default 200). |
| Views | --view=VIEW_ID:DISPLAY_ID; the display id defaults to default when omitted. |
--view wins over --entity-type, which wins over --images.
Examples:
# Train a Krea style from local files and start right away.
drush ai-finetuner:create "Ukiyo-e" --plugin=krea_lora --base-model=flux_dev \
--training-type=Style --trigger-word=ukiyo_style \
--images=/tmp/a.jpg,/tmp/b.jpg,/tmp/c.jpg --settings='{"max_train_steps":500}' --start
# Every media image, rendered through the ai_finetuner view mode.
drush ai-finetuner:create "Brand style" --plugin=krea_lora \
--entity-type=media --bundle=image --view-mode=ai_finetuner
# A view with an "AI fine-tuning dataset" display.
drush ai-finetuner:create "Products" --plugin=krea_lora --view=products:ai_finetuner_1 --start
Preview the dataset¶
drush ai-finetuner:dataset 3
Lists what the job would send: file name, MIME type and size for image datasets; id, title and the first 120 characters of text for text datasets.
Start¶
drush ai-finetuner:start 3
drush ai-finetuner:start 3 --wait --interval=60
Starts (or restarts) the training. Refuses if the job is already active. With --wait the command
polls the plugin every --interval seconds (default 30, minimum 5) and prints each status until the
training leaves the active states, then reports the result id or the failure message.
Status¶
drush ai-finetuner:status # refresh every active job, like cron
drush ai-finetuner:status 3 # refresh one job and print its state
drush ai-finetuner:status 3 --wait
Without an id this does what cron does. With an id it refreshes the job if it is active and prints
the stored state otherwise. --wait polls as with start.
Cancel and delete¶
drush ai-finetuner:cancel 3
drush ai-finetuner:delete 3
cancel asks the plugin to stop the training. delete removes the job after a confirmation; the
remote model or style is not touched.