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 import requests api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/become-image" # Prepare data and files data = {} files = {} data['seed'] = None # For parameter "image", you can send a raw file or a URI: # files['image'] = open('IMAGE_PATH', 'rb') # To send a file # data['image'] = 'IMAGE_URI' # To send a URI data['prompt'] = "a person" # For parameter "image_to_become", you can send a raw file or a URI: # files['image_to_become'] = open('IMAGE_PATH', 'rb') # To send a file # data['image_to_become'] = 'IMAGE_URI' # To send a URI data['negative_prompt'] = "" data['prompt_strength'] = 2 data['number_of_images'] = 2 data['denoising_strength'] = 1 data['instant_id_strength'] = 1 data['image_to_become_noise'] = 0.3 data['control_depth_strength'] = 0.8 data['disable_safety_checker'] = True data['image_to_become_strength'] = 0.75 headers = {'x-api-key': api_key} response = requests.post(url, data=data, files=files, 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


seedint ( default: 1 )

Fix the random seed for reproducibility


imagestr ( default: https://segmind-inference-io.s3.us-east-1.amazonaws.com/sample_images/image_71.webp )

An image of a person to be converted


promptstr ( default: a person )


image_to_becomestr ( default: https://segmind-inference-io.s3.amazonaws.com/sample_images/40548cb9-ae1f-4caa-969d-382c913a74ef.webp )

Any image to convert the person to


negative_promptstr ( default: 1 )

Things you do not want in the image


prompt_strengthfloat ( default: 2 )

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.

min : 0,

max : 3


number_of_imagesint ( default: 2 )

Number of images to generate

min : 1,

max : 10


denoising_strengthfloat ( default: 1 )

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

min : 0,

max : 1


instant_id_strengthfloat ( default: 1 )

How strong the InstantID will be.

min : 0,

max : 1


image_to_become_noisefloat ( default: 0.3 )

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

min : 0,

max : 1


control_depth_strengthfloat ( default: 0.8 )

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

min : 0,

max : 1


disable_safety_checkerbool ( default: true )

Disable safety checker for generated images


image_to_become_strengthfloat ( default: 0.75 )

How strong the style will be applied

min : 0,

max : 1

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.

Profile Photo Style Transfer

Profile Photo Style Transfer is a cutting-edge tool designed to adapt any picture of a face into another image. Utilizing IP Adapter with advanced style transfer techniques, it seamlessly transforms facial images, allowing for remarkable artistic expression and creativity. Whether you're looking to blend faces into new scenes or apply unique artistic styles, Profile Photo Style Transfer model provides a powerful and intuitive solution.