Customizing Realistic Human Photos

v1
post
/1/ai/{product_id}/images/generations/photo_maker

Customizing Realistic Human Photos To stylize the image, make sure to use the class word corresponding to the image you want to customize, followed by the trigger word: img. For example: man img, woman img, or girl img. Prompt example: Instagram photo, portrait photo of a woman img, colorful, perfect face, natural skin, hard shadows, film grain Upload the images of the individual you wish to customize. While a single image is sufficient, providing additional images can yield better results. Make sure that the face occupies the majority of the uploaded image.

Path parameters

product_id
requiredstring
Examples:example

Body Parameters

application/json
guidance_scalenumber

Weights for the prompt. Increasing guidance makes generation follow more closely to the prompt.

Examples:5.0
imagesrequiredarrayofstring (binary)
MaxLength:6

Upload the images of the individual you wish to customize. While a single image is sufficient, providing additional images can yield better results. Ensure that the face occupies the majority of the uploaded image.

ninteger
Min:1Max:5

The number of images to generate (default: 1)

Examples:1
negative_promptstring

The prompt does not guide the image generation. The maximum length is 77 tokens, Note that the "sdxl_lightning" and "flux" model does not support this feature.

Examples:asymmetry, worst quality, low quality
promptrequiredstring

Provide a text description to stylize the image. Make sure to follow the class word you want to customize with the trigger word: img, such as: man img, woman img, or girl img

Examples:sci-fi, closeup portrait photo of a man img wearing sunglasses in an Iron Man suit, face, slim body, high quality, film grain
qualitystring
Possible values:hdstandard

The quality of the image that will be generated (default: standard)

Examples:standard
response_formatstring
Possible values:b64_jsonurl

The format in which the generated images are returned. Currently, only 'b64_json' is supported as the response format

Examples:b64_json
sizestring
Possible values:1024x10241024x17921792x1024

The size of the generated images.

Examples:1024x1024
stylestring
Possible values:cinematiccomic_bookdigital_artdisney_charactorenhancefantasy_artline_artlowpolyneonpunkphotographic

Change the style to guidance for the generation

Examples:neonpunk
style_strength_ratiointeger
Min:10Max:50

Adjust the Style strength to 15-50. The larger the number, the less ID fidelity, but the stylization ability will be better.

Examples:15
syncboolean

Response Body

application/json
datarequiredarrayofBase64image

Base64 image

createdrequiredinteger

The Unix timestamp (in seconds) of when the response was created.

Example request

                <?php
use GuzzleHttp\Client;

$client = new Client();
$headers = [
	'Authorization' => 'Bearer YOUR-TOKEN-HERE',
	'Content-Type' => 'application/json'
];

$body = '{
    "images": [
        "example"
    ],
    "prompt": "sci-fi, closeup portrait photo of a man img wearing sunglasses in an Iron Man suit, face, slim body, high quality, film grain"
}';

$request = new Request('POST', 'https://api.infomaniak.com/1/ai/{product_id}/images/generations/photo_maker', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
            

Example response

application/json
                
                    
{
"data":[
{
"b64_json":"example",
"revised_prompt":"example"
}
],
"created":69601
}