POST
javascript
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 41 42 43 44 45 46 const axios = require('axios'); const FormData = require('form-data'); const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/become-image"; const reqBody = { "image": "https://segmind-inference-io.s3.us-east-1.amazonaws.com/sample_images/image_71.webp", "prompt": "a person", "image_to_become": "https://segmind-inference-io.s3.amazonaws.com/sample_images/40548cb9-ae1f-4caa-969d-382c913a74ef.webp", "prompt_strength": 2, "number_of_images": 2, "denoising_strength": 1, "instant_id_strength": 1, "image_to_become_noise": 0.3, "control_depth_strength": 0.8, "disable_safety_checker": true, "image_to_become_strength": 0.75 }; (async function() { try { const formData = new FormData(); // Append regular fields for (const key in reqBody) { if (reqBody.hasOwnProperty(key)) { formData.append(key, reqBody[key]); } } // Convert and append images as Base64 if necessary const response = await axios.post(url, formData, { headers: { 'x-api-key': api_key, ...formData.getHeaders() } }); console.log(response.data); } catch (error) { console.error('Error:', error.response ? error.response.data : error.message); } })();
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.