1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 const axios = require('axios'); const api_key = "YOUR API KEY"; const url = "https://api.segmind.com/workflows/66795d147e07d71865417d96-v4"; const data = { model_image: "publicly accessible image link" }; axios.post(url, data, { headers: { 'x-api-key': api_key, 'Content-Type': 'application/json' } }).then((response) => { console.log(response.data); });
Response
application/json
1 2 3 4 5 { "poll_url": "<base_url>/requests/<some_request_id>", "request_id": "some_request_id", "status": "QUEUED" }

You can poll the above link to get the status and output of your request.

Response
application/json
1 2 3 4 5 6 { "white_tshirt": "image in URL Format", "black_tshirt": "image in URL Format", "red_tshirt": "image in URL Format", "pink_tshirt": "image in URL Format" }

Attributes


model_imageimage*

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

T-shirt Color Change

Change the colors of a t-shirt worn by a model using an advanced inpainting workflow to achieve precise and accurate results. This method allows for dynamic alterations of t-shirt colors, enabling personalized and creative modifications according to specific needs.

How the T-shirt Color Change Workflow Works

The T-shirt Color Change workflow employs a systematic approach to alter the color of t-shirts in images:

  • Automatic Mask Generation: Initially, the workflow generates a mask specifically targeting the t-shirt on a human model using an automatic mask generator. This feature ensures that only the t-shirt area is affected during the color change process.

  • Image and Mask Processing: The input image, along with the generated mask, is fed into the Fooocus model. This AI model is designed to handle inpainting tasks effectively, ensuring the integrity of the original image while modifying the t-shirt color.

  • Text Prompt Utilization: Users provide a text prompt specifying the desired t-shirt color. The AI interprets these instructions to seamlessly blend new colors onto the specified area, creating a natural and realistic appearance.

How to Use the T-shirt Color Change Workflow

  1. Provide an Image: Upload a photo of the model wearing a t-shirt you wish to alter in color.

  2. Generate a Mask: Use the automatic mask generator to isolate the t-shirt area from the rest of the image.

  3. Input Color Prompt: Enter a text prompt indicating the new color you wish to apply to the t-shirt.

  4. Execute and Retrieve: The workflow processes the inputs and generates the modified image with the newly colored t-shirt.

Use Cases

  • Fashion Design: Experiment with different t-shirt colors for fashion portfolios or clothing line presentations.

  • E-commerce: Display a variety of color options for a single t-shirt design on retail websites without the need for separate photo sessions.

  • Marketing and Advertising: Create visually appealing graphics for marketing materials showcasing apparel in various colors.

  • Personalization: Allow consumers to visualize and select preferred t-shirt colors for custom orders.