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
Fix the random seed for reproducibility
An image of a person to be converted
Any image to convert the person to
Things you do not want in the image
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 images to generate
min : 1,
max : 10
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
How strong the InstantID will be.
min : 0,
max : 1
How much noise to add to the style image before processing. An alternative way of controlling stength.
min : 0,
max : 1
Strength of depth controlnet. The bigger this is, the more controlnet affects the output.
min : 0,
max : 1
Disable safety checker for generated images
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 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.