Profile Photo Style Transfer

Turn any image of a face into artwork using Stable Diffusion Controlnet and IPAdapter

~68.29s
~$0.106
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/become-image"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "image": "https://segmind-inference-io.s3.us-east-1.amazonaws.com/sample_images/image_71.webp",
12    "prompt": "a person",
13    "image_to_become": "https://segmind-inference-io.s3.amazonaws.com/sample_images/40548cb9-ae1f-4caa-969d-382c913a74ef.webp",
14    "prompt_strength": 2,
15    "number_of_images": 2,
16    "denoising_strength": 1,
17    "instant_id_strength": 1,
18    "image_to_become_noise": 0.3,
19    "control_depth_strength": 0.8,
20    "disable_safety_checker": true,
21    "image_to_become_strength": 0.75
22}
23
24response = requests.post(url, headers=headers, json=data)
25
26if response.status_code == 200:
27    result = response.json()
28    print(json.dumps(result, indent=2))
29else:
30    print(f"Error: {response.status_code}")
31    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/become-image

Parameters

control_depth_strengthoptional
number

Strength of depth controlnet. The bigger this is, the more controlnet affects the output.

Default: 0.8Range: 0 - 1
denoising_strengthoptional
number

How much of the original image of the person to keep. 1 is the complete destruction of the original image, 0 is the original image

Default: 1Range: 0 - 1
disable_safety_checkeroptional
boolean

Disable safety checker for generated images

Default: true
imageoptional
string (uri)

An image of a person to be converted

Default: "https://segmind-inference-io.s3.us-east-1.amazonaws.com/sample_images/image_71.webp"
image_to_becomeoptional
string (uri)

Any image to convert the person to

Default: "https://segmind-inference-io.s3.amazonaws.com/sample_images/40548cb9-ae1f-4caa-969d-382c913a74ef.webp"
image_to_become_noiseoptional
number

How much noise to add to the style image before processing. An alternative way of controlling stength.

Default: 0.3Range: 0 - 1
image_to_become_strengthoptional
number

How strong the style will be applied

Default: 0.75Range: 0 - 1
instant_id_strengthoptional
number

How strong the InstantID will be.

Default: 1Range: 0 - 1
negative_promptoptional
string

Things you do not want in the image

Default: ""
number_of_imagesoptional
integer

Number of images to generate

Default: 2Range: 1 - 10
promptoptional
string
Default: "a person"
prompt_strengthoptional
number

Strength of the prompt. This is the CFG scale, higher numbers lead to stronger prompt, lower numbers will keep more of a likeness to the original.

Default: 2Range: 0 - 3
seedoptional
integer

Fix the random seed for reproducibility

Default: null

Response Type

Returns: Image

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out