You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the API, I make base64 image format (target and source) And I make a request to the server where the SD with ReActor is located. But if I don't use the saved face_models, then I get black and white images. What am I doing wrong?
Also, the question is whether it is possible to create a new face model using the image API?
My code:
`with open("5.png", "rb") as image_file:
base64_string = base64.b64encode(image_file.read()).decode('utf-8')
with open("2.png", "rb") as image_file2:
result = base64.b64encode(image_file2.read()).decode('utf-8')
payload_reactor = {
"source_image": "data:image/png;base64," + base64_string, # I tried both with and without the addition of this line ("data:image/png;base64,")
"target_image": "data:image/png;base64," + result,
"source_faces_index": [0],
"face_index": [0],
"upscaler": "None",
"scale": 1,
"upscale_visibility": 1,
"face_restorer": "CodeFormer",
"restorer_visibility": 1,
"codeformer_weight": 0.5,
"restore_first": 1,
"model": "inswapper_128.onnx",
"gender_source": 0,
"gender_target": 0,
"save_to_file": 0,
"result_file_path": "",
"device": "CUDA",
"mask_face": 0,
"select_source": 0,
"face_model": "None",
"source_folder": "",
"random_image": 0,
"upscale_force": 0,
"det_thresh": 0.5,
"det_maxnum": 0
}
response = requests.post(url=f'{url}/reactor/image', json=payload_reactor)
r_reactor = response.json()
with open("output_reactor1.png", 'wb') as f:
f.write(base64.b64decode(temp))`
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Using the API, I make base64 image format (target and source) And I make a request to the server where the SD with ReActor is located. But if I don't use the saved face_models, then I get black and white images. What am I doing wrong?
Also, the question is whether it is possible to create a new face model using the image API?
My code:
`with open("5.png", "rb") as image_file:
base64_string = base64.b64encode(image_file.read()).decode('utf-8')
with open("2.png", "rb") as image_file2:
result = base64.b64encode(image_file2.read()).decode('utf-8')
payload_reactor = {
"source_image": "data:image/png;base64," + base64_string, # I tried both with and without the addition of this line ("data:image/png;base64,")
"target_image": "data:image/png;base64," + result,
"source_faces_index": [0],
"face_index": [0],
"upscaler": "None",
"scale": 1,
"upscale_visibility": 1,
"face_restorer": "CodeFormer",
"restorer_visibility": 1,
"codeformer_weight": 0.5,
"restore_first": 1,
"model": "inswapper_128.onnx",
"gender_source": 0,
"gender_target": 0,
"save_to_file": 0,
"result_file_path": "",
"device": "CUDA",
"mask_face": 0,
"select_source": 0,
"face_model": "None",
"source_folder": "",
"random_image": 0,
"upscale_force": 0,
"det_thresh": 0.5,
"det_maxnum": 0
}
response = requests.post(url=f'{url}/reactor/image', json=payload_reactor)
r_reactor = response.json()
with open("output_reactor1.png", 'wb') as f:
f.write(base64.b64decode(temp))`
результат такой получается:
Beta Was this translation helpful? Give feedback.
All reactions