The Task
For this example, we are going to fine-tune Qwen-Image-Edit to be able to turn a photo of a Yeti Mug from a product catalogue into a photo of the mug being used in the wild. The input images will be the mug we want in the scene on a black background (left) and the output will be the mug in a beautiful scene (right). The prompt that generated the image on the right was “a red headed woman sipping from the mug outdoors”. Notice we did not have to say “yeti mug”, but instead we teach the model that “mug” in our context should always be the mug from the reference image.Creating a Repository
Oxen.ai repositories are used to store and version your data and models. We can create a new repository by clicking the “Create New Repository” button in your Oxen.ai dashboard. You will upload your dataset to the repository, and when the fine-tune is complete, the model weights will be saved to the repository on a branch. By versioning your data and models together, you can always track the data that was used to train the model.Uploading the Dataset
From your repository, you can click the “Add File” button to upload your dataset. The upload supports unpacking zip files if you want to upload a directory of images. For image editing models, you will need three things:- Input images
- Reference images
- Prompts for the edits or changes we want to make
Formatting the Dataset
When you upload tabular data files (like CSV, JSONL, or Parquet) to Oxen.ai, they get superpowers. For example, you can enable image rendering on your image columns to show as thumbnails in the dataset. To view the images, click the “✏️” edit button above the dataset, then edit the column to enable image rendering. The video below shows the whole process. This lets you view images, reference images, and prompts all in one place. In this case we have one column calledimage that represents the output we want, and a column called control_image that represents the reference image that we want to feed as input. There is a third column for the prompt that describes the edits or changes we want to make.
The image column needs to contain the relative path to the image from the root of the repository. For example, if the image is in the images folder, the path should be images/image_0.png.
Kicking off the Fine-Tune
The other superpower your csv file gets is that you can kick off a fine-tune from the dataset page. Click the “Actions” button and select “Fine-Tune a Model”. This will take you to the fine-tune page where you can select the model you want to fine-tune. Select the “Qwen-Image-Edit” model, and make sure the “Control Image” column is set tocontrol_image column, the “Image” column is set to image column, and the “Prompt” column is set to prompt column.
You can also upload some test images and prompts that will be used as samples during the fine-tune.