Segmind FaceSwap Comic v1

FaceSwap Comic v1 is an AI-powered face swapping model designed to blend real faces into illustrated or cartoon-style images while preserving the target’s artistic look. Ideal for personalized children’s storybooks and stylized content, it offers fine control over facial expression, realism, and stylistic adaptation.


API

If you're looking for an API, you can choose from your desired programming language.

POST
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 import requests import base64 # Use this function to convert an image file from the filesystem to base64 def image_file_to_base64(image_path): with open(image_path, 'rb') as f: image_data = f.read() return base64.b64encode(image_data).decode('utf-8') # Use this function to fetch an image from a URL and convert it to base64 def image_url_to_base64(image_url): response = requests.get(image_url) image_data = response.content return base64.b64encode(image_data).decode('utf-8') # Use this function to convert a list of image URLs to base64 def image_urls_to_base64(image_urls): return [image_url_to_base64(url) for url in image_urls] api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/faceswap-comic" # Request payload data = { "source_image": image_url_to_base64("https://segmind-resources.s3.amazonaws.com/input/217bc1e2-dfec-4c4c-9f65-221666072a59-2cb41fda-f443-42ec-9048-2a8f4a355d30_1.png"), # Or use image_file_to_base64("IMAGE_PATH") "target_image": image_url_to_base64("https://segmind-resources.s3.amazonaws.com/input/44e264ec-4ae7-4d90-bb3a-fb6215fcd359-29570e4d-b67e-4612-bbb6-ae4802b672a1_1.png"), # Or use image_file_to_base64("IMAGE_PATH") "face_strength": 0.8, "style_strength": 0.8, "seed": 63255, "steps": 10, "cfg": 1.5, "output_format": "jpeg", "output_quality": 95, "base64": False } headers = {'x-api-key': api_key} response = requests.post(url, json=data, headers=headers) print(response.content) # The response is the generated image
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


promptstr ( default: 1 )

Optional prompt used to guide facial expressions or moods (such as happy, crying, sleeping, or closed eyes)


source_imageimage *

The source image for face swapping


target_imageimage *

The target image for face swapping


face_strengthfloat ( default: 0.8 )

Strength of face preservation

min : 0,

max : 1


style_strengthfloat ( default: 0.8 )

Strength of style adaptation

min : 0,

max : 2


seedint ( default: 63255 )

Seed number for reproducible results


stepsint ( default: 10 )

Number of inference steps. Increase to improve details and overall output quality.

min : 1,

max : 50


cfgfloat ( default: 1.6 )

Classifier-free guidance scale

min : 0.1,

max : 10


output_formatenum:str ( default: jpeg )

Output image format

Allowed values:


output_qualityint ( default: 95 )

Output image quality

min : 1,

max : 100


base64bool ( default: 1 )

Output as base64

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.

Segmind FaceSwap Comic v1 is a specialized face-swapping model designed to maintain the artistic integrity of illustrated or stylized target images—making it ideal for use cases like personalized storybooks for children. This model allows users to transfer a face from a real photo onto a drawn or cartoon-style target image while preserving the original’s visual style.

It supports optional text prompts to guide expressions or facial details (e.g., “happy,” “eyes closed”), which improves alignment in stylized compositions.

Using parameters effectively

Optional prompt that can be used to guide facial expressions or moods (such as happy, crying, sleeping, or closed eyes). While it's not mandatory, adding a descriptive prompt can help improve results, especially when the face swap doesn't align well with the expected outcome.

The face_strength parameter controls how strongly the source face is preserved in the final image. A higher value ensures that the generated face closely matches the source, but may override the target image's artistic or stylized look. In cases where the target image is a comic or illustration, using a lower face strength can help blend the styles better.

The style_strength influences how much the output should adapt to the target image's visual style. A higher value makes the final result more consistent with the target’s style, which is useful for cartoonized or illustrated faces. Lower values favor realism from the source.

CFG (Classifier-Free Guidance) affects how strongly the model adheres to the internal style logic, and also influences the brightness and tone of the output skin. A higher CFG scale can result in darker skin tones, while lower values may keep the tones lighter and closer to the original.

Pipeline Limitations

The model currently supports only single-face swapping: both the source and target images should ideally have just one prominent face. If the target contains multiple faces, the model may randomly apply the swap to all or fail to detect the intended face properly.

It is strongly recommended to match gender between source and target images. While the model can technically swap any face, female-specific hairstyles like buns, braids, or ribbons may not carry over accurately onto male faces and vice versa.

The model generally handles accessories like eyeglasses, beards, and facial structure well. However, in cases of small or distant faces, it might fail to classify the gender or features correctly. This can be mitigated by providing an explicit description in the prompt.

Cookie settings

We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept all", you consent to our use of cookies.