Spaces:
Paused
Paused
Update main.py
Browse files
main.py
CHANGED
|
@@ -178,8 +178,8 @@ def nudify():
|
|
| 178 |
seed = int(data["seed"])
|
| 179 |
|
| 180 |
prompt ="A "+cameraAngle+" angle full naked portrait of a "+age+" aged "+base+" with a "+bodyType+" body naked, "+action+", "+boobs+" boobs, "+ass+" ass, nude, naked, nsfw"
|
| 181 |
-
modelGen = "v1-5-inpainting.safetensors [21c7ab71]"
|
| 182 |
-
|
| 183 |
|
| 184 |
input_img = Image.open(requests.get(url,stream=True).raw)
|
| 185 |
# input_img.save("input.png")
|
|
@@ -230,23 +230,22 @@ def nudify():
|
|
| 230 |
imgOut.save(buffered, format="png")
|
| 231 |
base64_str = base64.b64encode(buffered.getvalue()).decode("utf-8")
|
| 232 |
|
| 233 |
-
url2 = "https://api.prodia.com/v1/
|
| 234 |
|
| 235 |
payload = json.dumps({
|
| 236 |
"inpainting_full_res": False,
|
| 237 |
"imageUrl": url,
|
| 238 |
"maskData": base64_str,
|
| 239 |
-
"model": modelGen,
|
| 240 |
"prompt": prompt,
|
| 241 |
"negative_prompt": "bad anatomy, bad hands, three hands, three legs, bad arms, missing legs, missing arms, poorly drawn face, bad face, fused face, cloned face, worst face, three crus, extra crus, fused crus, worst feet, three feet, fused feet, fused thigh, three thigh, fused thigh, extra thigh, worst thigh, missing fingers, extra fingers, ugly fingers, long fingers, horn, extra eyes, huge eyes, 2girl, amputation, disconnected limbs",
|
| 242 |
-
"denoising_strength":
|
| 243 |
"cfg_scale": 7,
|
| 244 |
-
"mask_blur": 4,
|
| 245 |
"inpainting_fill": 2,
|
| 246 |
"inpainting_mask_invert": 0,
|
| 247 |
"seed": seed,
|
| 248 |
"style_preset" : style,
|
| 249 |
-
"upscale": True
|
|
|
|
| 250 |
})
|
| 251 |
headers = {
|
| 252 |
'X-Prodia-Key': 'f2c81250-a5d8-461e-9caa-9fdb5abb5b60',
|
|
@@ -337,23 +336,22 @@ def clotheChanger():
|
|
| 337 |
imgOut.save(buffered, format="png")
|
| 338 |
base64_str = base64.b64encode(buffered.getvalue()).decode("utf-8")
|
| 339 |
|
| 340 |
-
url2 = "https://api.prodia.com/v1/
|
| 341 |
|
| 342 |
payload = json.dumps({
|
| 343 |
"inpainting_full_res": False,
|
| 344 |
"imageUrl": url,
|
| 345 |
"maskData": base64_str,
|
| 346 |
-
"model": modelGen,
|
| 347 |
"prompt": prompt,
|
| 348 |
"negative_prompt": "bad anatomy, bad hands, three hands, three legs, bad arms, missing legs, missing arms, poorly drawn face, bad face, fused face, cloned face, worst face, three crus, extra crus, fused crus, worst feet, three feet, fused feet, fused thigh, three thigh, fused thigh, extra thigh, worst thigh, missing fingers, extra fingers, ugly fingers, long fingers, horn, extra eyes, huge eyes, 2girl, amputation, disconnected limbs",
|
| 349 |
-
"denoising_strength":
|
| 350 |
"cfg_scale": 7,
|
| 351 |
-
"mask_blur": 4,
|
| 352 |
"inpainting_fill": 2,
|
| 353 |
"inpainting_mask_invert": 0,
|
| 354 |
"seed": seed,
|
| 355 |
"style_preset" : style,
|
| 356 |
-
"upscale": True
|
|
|
|
| 357 |
})
|
| 358 |
headers = {
|
| 359 |
'X-Prodia-Key': 'f2c81250-a5d8-461e-9caa-9fdb5abb5b60',
|
|
|
|
| 178 |
seed = int(data["seed"])
|
| 179 |
|
| 180 |
prompt ="A "+cameraAngle+" angle full naked portrait of a "+age+" aged "+base+" with a "+bodyType+" body naked, "+action+", "+boobs+" boobs, "+ass+" ass, nude, naked, nsfw"
|
| 181 |
+
# modelGen = "v1-5-inpainting.safetensors [21c7ab71]"
|
| 182 |
+
modelGen = "sd_xl_base_1.0_inpainting_0.1.safetensors [5679a81a]"
|
| 183 |
|
| 184 |
input_img = Image.open(requests.get(url,stream=True).raw)
|
| 185 |
# input_img.save("input.png")
|
|
|
|
| 230 |
imgOut.save(buffered, format="png")
|
| 231 |
base64_str = base64.b64encode(buffered.getvalue()).decode("utf-8")
|
| 232 |
|
| 233 |
+
url2 = "https://api.prodia.com/v1/sdxl/inpainting"
|
| 234 |
|
| 235 |
payload = json.dumps({
|
| 236 |
"inpainting_full_res": False,
|
| 237 |
"imageUrl": url,
|
| 238 |
"maskData": base64_str,
|
|
|
|
| 239 |
"prompt": prompt,
|
| 240 |
"negative_prompt": "bad anatomy, bad hands, three hands, three legs, bad arms, missing legs, missing arms, poorly drawn face, bad face, fused face, cloned face, worst face, three crus, extra crus, fused crus, worst feet, three feet, fused feet, fused thigh, three thigh, fused thigh, extra thigh, worst thigh, missing fingers, extra fingers, ugly fingers, long fingers, horn, extra eyes, huge eyes, 2girl, amputation, disconnected limbs",
|
| 241 |
+
"denoising_strength": 1,
|
| 242 |
"cfg_scale": 7,
|
|
|
|
| 243 |
"inpainting_fill": 2,
|
| 244 |
"inpainting_mask_invert": 0,
|
| 245 |
"seed": seed,
|
| 246 |
"style_preset" : style,
|
| 247 |
+
"upscale": True,
|
| 248 |
+
"mask_blur": 0
|
| 249 |
})
|
| 250 |
headers = {
|
| 251 |
'X-Prodia-Key': 'f2c81250-a5d8-461e-9caa-9fdb5abb5b60',
|
|
|
|
| 336 |
imgOut.save(buffered, format="png")
|
| 337 |
base64_str = base64.b64encode(buffered.getvalue()).decode("utf-8")
|
| 338 |
|
| 339 |
+
url2 = "https://api.prodia.com/v1/sdxl/inpainting"
|
| 340 |
|
| 341 |
payload = json.dumps({
|
| 342 |
"inpainting_full_res": False,
|
| 343 |
"imageUrl": url,
|
| 344 |
"maskData": base64_str,
|
|
|
|
| 345 |
"prompt": prompt,
|
| 346 |
"negative_prompt": "bad anatomy, bad hands, three hands, three legs, bad arms, missing legs, missing arms, poorly drawn face, bad face, fused face, cloned face, worst face, three crus, extra crus, fused crus, worst feet, three feet, fused feet, fused thigh, three thigh, fused thigh, extra thigh, worst thigh, missing fingers, extra fingers, ugly fingers, long fingers, horn, extra eyes, huge eyes, 2girl, amputation, disconnected limbs",
|
| 347 |
+
"denoising_strength": 1,
|
| 348 |
"cfg_scale": 7,
|
|
|
|
| 349 |
"inpainting_fill": 2,
|
| 350 |
"inpainting_mask_invert": 0,
|
| 351 |
"seed": seed,
|
| 352 |
"style_preset" : style,
|
| 353 |
+
"upscale": True,
|
| 354 |
+
"mask_blur": 0
|
| 355 |
})
|
| 356 |
headers = {
|
| 357 |
'X-Prodia-Key': 'f2c81250-a5d8-461e-9caa-9fdb5abb5b60',
|