Skip to main content

Extract swatch

On this page we walk you step by step through creating a Workforce Flow that:

  • Extracts a swatch from the most representative part of an image
  • Adds a human review step so you can see the swatch alongside the original image

A swatch is a convenient way of getting detail of a representative area of a product, for example a fabric, curtains, or a dress and with Flows you can automate this action and perform it at scale.

Extract swatch flow overview Extract swatch flow overview

Step 1- Create the form trigger
Link copied!

  • Create a new content flow and give it a label and description.

  • From the Action Library open the Manual triggers and drag a Form trigger to your flow.

Add the form trigger action used to start the flow

  • Click the Configure Input Form button and add the following fields:
    • An image. This will be the image to take the swatch from: Image.

    • A single line text field to represent the name of the product to focus on when extracting the swatch (for example leather bag, sunglasses, dress): Product name. If this is not included, the action is prompted to find the most obvious product within the image and to extract a swatch from that.

Configure the form action with fields for the image and product name

Step 2- Extract a swatch from the image
Link copied!

Using the information entered in the Form trigger, the Extract Swatch action will extract the swatch from the image. If you specify a product name, it'll use AI to focus on the area of the image the contains that product.

  • Open the Image section in the Actions Library and drag the Extract Swatch action to the flow. Connect it to the output of the Form Trigger.

  • Choose your model.

  • The Image to extract the swatch from should be set to the Image returned by the Form Trigger.

  • The Size of the swatch can be whatever you want, but in this example we're using a width and height of 300 pixels.

  • Set the Product to the Product name returned by the Form Trigger. This will help tell Extract Swatch what to focus on.

Extract the swatch from the image

tip

For more details on how this action works, see Extract Swatch.

Step 3- Review the swatch and original image
Link copied!

The final step is to review the generated swatch alongside the original image to ensure that it is suitable.

  • Open the Review and moderation section in the Action Library and drag the Human Review action to your flow. Connect it to the output of Extract Swatch.

  • Enter a Review Task Label, and set the Data to review by adding the Swatch Image returned by Extract Swatch and the original Image from the Form Trigger.

Add and configure human review

Try it out
Link copied!

Save the flow. It's now ready to run.

  • Click Run at the top of the window.

  • Upload an image and enter a product name to focus the swatch on. In this example we're focusing on the model's dress.

  • Click the Start Run button.

Running the flow

The swatch is generated. You can view it by expanding the card.

Extracting the flow

  • Open the review.

The swatch is now shown in the review window alongside the original image so you can check it for suitability.

Reviewing the swatch alongside the original image