Skip to main content
With this guide, you will:
  • Create an image-editing fine-tune
  • Start the fine-tune run
  • Monitor the fine-tune until it completes
  • Deploy the fine-tuned model
  • Run inference with the deployed model
We will use one of the Qwen image-editing models described in Available Fine-Tuning Models:
  • base_model: Qwen/Qwen-Image-Edit
  • script_type: image_editing
Your dataset should follow the schema described there:
  • control_image_column – Input/reference image to edit
  • caption_column – Text prompt describing the desired edit
  • image_column – Target/output image after the edit

Prerequisites

  • Repository on Oxen with your training data committed, for example:
    • Namespace: Tutorials
    • Repository: ProductImageEdits
  • Dataset resource inside that repo, for example:
    • main/train_image_edits.parquet
    • Each row contains paths to the control image and edited image, plus a caption.
  • API key with access to the repo:
    • Exported as OXEN_API_KEY
  • Base URL for the Oxen API:
    • Cloud example: https://hub.oxen.ai
    • Exported as OXEN_BASE_URL (optional, defaults shown below)
You can set these in your shell:
For the examples below, we will use:
  • resource: main/train_image_edits.parquet
  • base_model: Qwen/Qwen-Image-Edit
  • script_type: image_editing
Training parameters (you can adjust these to your needs):
  • control_image_column: control_image
  • caption_column: caption
  • image_column: edited_image
  • epochs: 1
  • batch_size: 1
  • learning_rate: 0.0001
  • grad_accum: 1
  • lora_alpha: 16
  • lora_rank: 16
  • seq_length: 1024
  • logging_steps: 10
  • enable_thinking: false
  • neftune_noise_alpha: 0.0
  • save_steps_ratio: 0.25
  • save_strategy: epoch
  • use_lora: true

Step 1 – Create an Image Editing Fine-Tune

Endpoint
  • POST /api/repos/{owner}/{repo}/fine_tunes
Example curl request:
The response will include a fine_tune object. For example:
Save the id (for example ft_img_12345) for the next steps. If you have jq installed, you can capture it directly:

Step 2 – Start the Fine-Tune Run

Once you have a fine_tune.id, trigger the run. Endpoint
  • POST /api/repos/{owner}/{repo}/fine_tunes/{fine_tune_id}/actions/run
Example curl request:

Step 3 – Monitor Fine-Tune Status

You can poll the fine-tune to see when it completes. Endpoint
  • GET /api/repos/{owner}/{repo}/fine_tunes/{fine_tune_id}
Example curl loop (bash):

Step 4 – Deploy the Fine-Tuned Image Model

Once the fine-tune completes, you can deploy it to a dedicated GPU-backed endpoint via the deploy API. Endpoint
  • POST /api/repos/{owner}/{repo}/fine_tunes/{fine_tune_id}/deploy
Example curl request:
The response will include information about the deployment, including the model identifier you can pass to the image editing inference API (for example, a slug such as oxen:your-fine-tuned-image-edit-model). If the response contains a field like model_slug, you can capture it with jq:

Step 5 – Run Inference with the Deployed Model

With the deployment live, you can call the image editing inference endpoint using the deployed model identifier. Endpoint
  • POST /api/ai/images/edit
Example curl request (single input image):
For models that support multiple input images (for example when using a multi-image editing base model), you can pass an array of image URLs:
These requests mirror the general image editing examples, but use your fine-tuned image model as the model value instead of a base model. For more background on the image editing inference API, see the Image Editing examples. With these five steps, you have a complete end-to-end image fine-tuning, deployment, and inference workflow using only curl, fully scriptable from the command line.