PixelFlow Template

Change hair styles and colors

Playground

Try the model in real time below.

ea3c5a6b-69f6-4786-a8eb-7884d183098a.jpg selected

You can drop your own file here

output image


Pixelflow

This model is actually a pixelflow you can see the internal workings of the model here, and also clone and play around with it, just click the Run button on the right.


API

If you're looking for an API, here is a sample code in NodeJS to help you out.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 const axios = require('axios'); const api_key = "YOUR API KEY"; const url = "https://api.segmind.com/workflows/66721b60458d41fc488fa95d-v1"; const data = { face_image: "publicly accessible image link", hair_color: "the user input string" }; 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 { "output_image": "image in URL Format" }

Attributes


face_imageimage*

hair_colorstr*

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.

FEATURES

PixelFlow allows you to use all these features

Unlock the full potential of generative AI with Segmind. Create stunning visuals and innovative designs with total creative control. Take advantage of powerful development tools to automate processes and models, elevating your creative workflow.

Inferencing

Run generative AI models with minimal latencies and setup costs, optimizing resource use and speed.

Inferencing

Run generative AI models with minimal latencies and setup costs, optimizing resource use and speed.

Inferencing

Run generative AI models with minimal latencies and setup costs, optimizing resource use and speed.

Inferencing

Run generative AI models with minimal latencies and setup costs, optimizing resource use and speed.

Hair Style and Color Change

Hair Style and Color Change workflow enables the transformation of hair aesthetics by altering hair styles and colors using advanced inpainting techniques. This workflow is designed to seamlessly integrate into image editing processes, allowing users to experiment with different hair looks by just providing text prompts.

How the Hair Style and Color Change Works

The Hair Style and Color Change workflow involves a structured approach with distinct computational steps:

  • Automatic Mask Generation: The process initiates with the creation of a hair mask utilizing an automatic mask generator. This step isolates the hair from the rest of the image, ensuring precise modifications.

  • Input and Processing: The image of the person along with the generated mask is forwarded to the Fooocus model. This AI model is specialized in inpainting techniques, capable of understanding the context and accurately applying the desired changes.

  • Text-Prompt Driven Rendering: By processing the text prompts, the model determines the specifics of the new hair style and color, generating an output that aligns with user specifications.

  • Output Image: The finalized image showcases a transformation in hair style or color that accurately reflects the input text prompts, maintaining a natural and coherent look.

How to Use the Hair Style and Color Change

  1. Image Selection: Begin with selecting the image you wish to alter.

  2. Mask Generation: Utilize the automatic mask generator to create a precise mask of the hair region.

  3. Text Prompt Submission: Enter a text prompt describing the desired hair style or color change, such as "wavy blonde".

  4. Model Processing: Allow the Fooocus model to process the image and the text input, generating the altered image.

  5. Review and Refine: Examine the output and, if necessary, adjust your text prompt for iterations to achieve desired results.

Use Cases

  • Virtual Hairstyling: Ideal for apps and platforms that offer virtual try-on experiences, helping users visualize potential hair style and color changes before real-world application.

  • Fashion and Beauty Industries: Useful for stylists and designers to experiment with and present new trends and looks without physical alterations.

  • Film and Media Production: Supports creative processes in determining character appearance changes efficiently.

  • Personal Use: Allows individuals to preview different hair transformations for personal styling decisions or social media content creation.

F.A.Q.

Frequently Asked Questions

Take creative control today and thrive.

Start building with a free account or consult an expert for your Pro or Enterprise needs. Segmind's tools empower you to transform your creative visions into reality.

Pixelflow Banner