zelenioncode / aicrop
- Public
- 274 runs
Prediction
zelenioncode/aicrop:935f34c9e2f435eb68cbd39b08f10e4ece78ec102850f935b7feae8a38aac982IDgpz5gd3bwouwdyhf64vrtgtgxeStatusSucceededSourceWebHardwareA40 (Large)Total durationCreatedInput
{ "image": "https://replicate.delivery/pbxt/KO7iBsJSGMPh7WZj1yU2DarqWPPlgpEtjoCKUWsJikBsNQwv/00014-3650094703.png" }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run zelenioncode/aicrop using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "zelenioncode/aicrop:935f34c9e2f435eb68cbd39b08f10e4ece78ec102850f935b7feae8a38aac982", { input: { image: "https://replicate.delivery/pbxt/KO7iBsJSGMPh7WZj1yU2DarqWPPlgpEtjoCKUWsJikBsNQwv/00014-3650094703.png" } } ); // To access the file URL: console.log(output.url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run zelenioncode/aicrop using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "zelenioncode/aicrop:935f34c9e2f435eb68cbd39b08f10e4ece78ec102850f935b7feae8a38aac982", input={ "image": "https://replicate.delivery/pbxt/KO7iBsJSGMPh7WZj1yU2DarqWPPlgpEtjoCKUWsJikBsNQwv/00014-3650094703.png" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Run zelenioncode/aicrop using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "version": "zelenioncode/aicrop:935f34c9e2f435eb68cbd39b08f10e4ece78ec102850f935b7feae8a38aac982", "input": { "image": "https://replicate.delivery/pbxt/KO7iBsJSGMPh7WZj1yU2DarqWPPlgpEtjoCKUWsJikBsNQwv/00014-3650094703.png" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2024-02-12T01:25:40.270397Z", "created_at": "2024-02-12T01:20:11.725218Z", "data_removed": false, "error": null, "id": "gpz5gd3bwouwdyhf64vrtgtgxe", "input": { "image": "https://replicate.delivery/pbxt/KO7iBsJSGMPh7WZj1yU2DarqWPPlgpEtjoCKUWsJikBsNQwv/00014-3650094703.png" }, "logs": "##########CONVERT IMAGE##########\nConvert picture to JPEG and detect face in the picture...\nDone, you can find the picture in /tmp/new_picture.jpg\n##########CONVERT IMAGE##########\n##########FACE DETECTION##########\nDetecting face in the picture...\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 125ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 81ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 18ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 35ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 13ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 12ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 12ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 12ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 12ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 11ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 11ms/step\n1/5 [=====>........................] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n5/5 [==============================] - 0s 2ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 105ms/step\nDone, the only one face is detected at the position {'x': 314, 'y': 106, 'width': 172, 'height': 253}\n##########FACE DETECTION##########\n##########OUTPAINTING##########\nMake a request to the API for outpainting the picture...\nStart the outpainting...\nThe face is at the position with scare coord : {'x': -111, 'y': -279, 'width': 1024, 'height': 1024}\nThe zone need outpainting is : {'top': 288, 'right': 160, 'bottom': 0, 'left': 120, 'json': ['up', 'right', 'left']}\n{'alwayson_scripts': {'ControlNet': {'args': [{'batch_images': '',\n'control_mode': 'Balanced',\n'enabled': False,\n'guidance_end': 1,\n'guidance_start': 0,\n'image': None,\n'input_mode': 'simple',\n'is_ui': True,\n'loopback': False,\n'low_vram': False,\n'model': 'None',\n'module': 'none',\n'output_dir': '',\n'pixel_perfect': False,\n'processor_res': -1,\n'resize_mode': 'Crop and Resize',\n'threshold_a': -1,\n'threshold_b': -1,\n'weight': 1}]},\n'Refiner': {'args': [False, '', 0.8]},\n'Seed': {'args': [1334, False, -1, 0, 0, 0]}},\n'batch_size': 1,\n'cfg_scale': 7,\n'comments': {},\n'denoising_strength': 0.95,\n'disable_extra_networks': False,\n'do_not_save_grid': True,\n'do_not_save_samples': True,\n'height': 1024,\n'init_images': ['base64image placeholder'],\n'initial_noise_multiplier': 1.0,\n'inpaint_full_res': False,\n'inpaint_full_res_padding': 32,\n'inpainting_fill': 1,\n'inpainting_mask_invert': 0,\n'mask_blur': 32,\n'mask_blur_x': 32,\n'mask_blur_y': 32,\n'n_iter': 1,\n'negative_prompt': '',\n'override_settings': {},\n'override_settings_restore_afterwards': True,\n'prompt': '',\n'resize_mode': 1,\n'restore_faces': False,\n's_churn': 0.0,\n's_min_uncond': 0.0,\n's_noise': 1.0,\n's_tmax': None,\n's_tmin': 0.0,\n'sampler_name': 'Euler a',\n'script_args': ['<p style=\"margin-bottom:0.75em\">Recommended settings: '\n'Sampling Steps: 80-100, Sampler: Euler a, Denoising '\n'strength: 0.8</p>',\n288,\n8,\n['up', 'right', 'left'],\n1,\n0.05],\n'script_name': 'outpainting mk2',\n'seed': 1334,\n'seed_enable_extras': True,\n'seed_resize_from_h': -1,\n'seed_resize_from_w': -1,\n'steps': 90,\n'styles': [],\n'subseed': -1,\n'subseed_strength': 0,\n'tiling': False,\n'width': 1024}\nDone, you can find the picture in /src/output_img2img_1.png\n##########OUTPAINTING##########", "metrics": { "predict_time": 196.82487, "total_time": 328.545179 }, "output": "https://replicate.delivery/pbxt/fVvquAKQ0ISgVKZf2rwwT0bru0FaPAdGATKpA0f4IQfJZJXJB/output_img2img_1.png", "started_at": "2024-02-12T01:22:23.445527Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/gpz5gd3bwouwdyhf64vrtgtgxe", "cancel": "https://api.replicate.com/v1/predictions/gpz5gd3bwouwdyhf64vrtgtgxe/cancel" }, "version": "935f34c9e2f435eb68cbd39b08f10e4ece78ec102850f935b7feae8a38aac982" }
Generated in##########CONVERT IMAGE########## Convert picture to JPEG and detect face in the picture... Done, you can find the picture in /tmp/new_picture.jpg ##########CONVERT IMAGE########## ##########FACE DETECTION########## Detecting face in the picture... 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 125ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 81ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 18ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 35ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 13ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 12ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 12ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 12ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 12ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 11ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 11ms/step 1/5 [=====>........................] - ETA: 5/5 [==============================] - 0s 2ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 105ms/step Done, the only one face is detected at the position {'x': 314, 'y': 106, 'width': 172, 'height': 253} ##########FACE DETECTION########## ##########OUTPAINTING########## Make a request to the API for outpainting the picture... Start the outpainting... The face is at the position with scare coord : {'x': -111, 'y': -279, 'width': 1024, 'height': 1024} The zone need outpainting is : {'top': 288, 'right': 160, 'bottom': 0, 'left': 120, 'json': ['up', 'right', 'left']} {'alwayson_scripts': {'ControlNet': {'args': [{'batch_images': '', 'control_mode': 'Balanced', 'enabled': False, 'guidance_end': 1, 'guidance_start': 0, 'image': None, 'input_mode': 'simple', 'is_ui': True, 'loopback': False, 'low_vram': False, 'model': 'None', 'module': 'none', 'output_dir': '', 'pixel_perfect': False, 'processor_res': -1, 'resize_mode': 'Crop and Resize', 'threshold_a': -1, 'threshold_b': -1, 'weight': 1}]}, 'Refiner': {'args': [False, '', 0.8]}, 'Seed': {'args': [1334, False, -1, 0, 0, 0]}}, 'batch_size': 1, 'cfg_scale': 7, 'comments': {}, 'denoising_strength': 0.95, 'disable_extra_networks': False, 'do_not_save_grid': True, 'do_not_save_samples': True, 'height': 1024, 'init_images': ['base64image placeholder'], 'initial_noise_multiplier': 1.0, 'inpaint_full_res': False, 'inpaint_full_res_padding': 32, 'inpainting_fill': 1, 'inpainting_mask_invert': 0, 'mask_blur': 32, 'mask_blur_x': 32, 'mask_blur_y': 32, 'n_iter': 1, 'negative_prompt': '', 'override_settings': {}, 'override_settings_restore_afterwards': True, 'prompt': '', 'resize_mode': 1, 'restore_faces': False, 's_churn': 0.0, 's_min_uncond': 0.0, 's_noise': 1.0, 's_tmax': None, 's_tmin': 0.0, 'sampler_name': 'Euler a', 'script_args': ['<p style="margin-bottom:0.75em">Recommended settings: ' 'Sampling Steps: 80-100, Sampler: Euler a, Denoising ' 'strength: 0.8</p>', 288, 8, ['up', 'right', 'left'], 1, 0.05], 'script_name': 'outpainting mk2', 'seed': 1334, 'seed_enable_extras': True, 'seed_resize_from_h': -1, 'seed_resize_from_w': -1, 'steps': 90, 'styles': [], 'subseed': -1, 'subseed_strength': 0, 'tiling': False, 'width': 1024} Done, you can find the picture in /src/output_img2img_1.png ##########OUTPAINTING##########
Prediction
zelenioncode/aicrop:935f34c9e2f435eb68cbd39b08f10e4ece78ec102850f935b7feae8a38aac982IDfjlklsdbe7zm4fq654dqmb52gmStatusSucceededSourceWebHardwareA40 (Large)Total durationCreatedInput
{ "image": "https://replicate.delivery/pbxt/KOAOcCA8qOZZvSMFsWfILcTigXcKT4vZBfbkgoRBkEKz8A7m/seggez.jpeg" }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run zelenioncode/aicrop using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "zelenioncode/aicrop:935f34c9e2f435eb68cbd39b08f10e4ece78ec102850f935b7feae8a38aac982", { input: { image: "https://replicate.delivery/pbxt/KOAOcCA8qOZZvSMFsWfILcTigXcKT4vZBfbkgoRBkEKz8A7m/seggez.jpeg" } } ); // To access the file URL: console.log(output.url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run zelenioncode/aicrop using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "zelenioncode/aicrop:935f34c9e2f435eb68cbd39b08f10e4ece78ec102850f935b7feae8a38aac982", input={ "image": "https://replicate.delivery/pbxt/KOAOcCA8qOZZvSMFsWfILcTigXcKT4vZBfbkgoRBkEKz8A7m/seggez.jpeg" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Run zelenioncode/aicrop using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "version": "zelenioncode/aicrop:935f34c9e2f435eb68cbd39b08f10e4ece78ec102850f935b7feae8a38aac982", "input": { "image": "https://replicate.delivery/pbxt/KOAOcCA8qOZZvSMFsWfILcTigXcKT4vZBfbkgoRBkEKz8A7m/seggez.jpeg" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2024-02-12T04:21:28.285259Z", "created_at": "2024-02-12T04:15:50.148410Z", "data_removed": false, "error": null, "id": "fjlklsdbe7zm4fq654dqmb52gm", "input": { "image": "https://replicate.delivery/pbxt/KOAOcCA8qOZZvSMFsWfILcTigXcKT4vZBfbkgoRBkEKz8A7m/seggez.jpeg" }, "logs": "##########CONVERT IMAGE##########\nConvert picture to JPEG and detect face in the picture...\nDone, you can find the picture in /tmp/new_picture.jpg\n##########CONVERT IMAGE##########\n##########FACE DETECTION##########\nDetecting face in the picture...\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 156ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 94ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 23ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 17ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 35ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 14ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 12ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 12ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 12ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 12ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 11ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 60ms/step\n1/6 [====>.........................] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n6/6 [==============================] - 0s 3ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 105ms/step\nDone, the only one face is detected at the position {'x': 231, 'y': 221, 'width': 366, 'height': 516}\n##########FACE DETECTION##########\n##########OUTPAINTING##########\nMake a request to the API for outpainting the picture...\nStart the outpainting...\nThe face is at the position with scare coord : {'x': -98, 'y': -33, 'width': 1024, 'height': 1024}\nThe zone need outpainting is : {'top': 48, 'right': 0, 'bottom': 0, 'left': 112, 'json': ['up', 'left']}\n{'alwayson_scripts': {'ControlNet': {'args': [{'batch_images': '',\n 'control_mode': 'Balanced',\n 'enabled': False,\n'guidance_end': 1,\n'guidance_start': 0,\n'image': None,\n'input_mode': 'simple',\n'is_ui': True,\n'loopback': False,\n'low_vram': False,\n'model': 'None',\n'module': 'none',\n 'output_dir': '',\n 'pixel_perfect': False,\n'processor_res': -1,\n 'resize_mode': 'Crop and Resize',\n'threshold_a': -1,\n'threshold_b': -1,\n'weight': 1}]},\n'Refiner': {'args': [False, '', 0.8]},\n'Seed': {'args': [1334, False, -1, 0, 0, 0]}},\n'batch_size': 1,\n'cfg_scale': 7,\n'comments': {},\n'denoising_strength': 0.95,\n'disable_extra_networks': False,\n'do_not_save_grid': True,\n'do_not_save_samples': True,\n'height': 1024,\n'init_images': ['base64image placeholder'],\n 'initial_noise_multiplier': 1.0,\n'inpaint_full_res': False,\n 'inpaint_full_res_padding': 32,\n'inpainting_fill': 1,\n'inpainting_mask_invert': 0,\n'mask_blur': 32,\n'mask_blur_x': 32,\n'mask_blur_y': 32,\n'n_iter': 1,\n'negative_prompt': '',\n'override_settings': {},\n'override_settings_restore_afterwards': True,\n'prompt': '',\n'resize_mode': 1,\n'restore_faces': False,\n 's_churn': 0.0,\n's_min_uncond': 0.0,\n 's_noise': 1.0,\n 's_tmax': None,\n 's_tmin': 0.0,\n 'sampler_name': 'Euler a',\n'script_args': ['<p style=\"margin-bottom:0.75em\">Recommended settings: '\n'Sampling Steps: 80-100, Sampler: Euler a, Denoising '\n'strength: 0.8</p>',\n112,\n8,\n['up', 'left'],\n1,\n0.05],\n'script_name': 'outpainting mk2',\n'seed': 1334,\n'seed_enable_extras': True,\n'seed_resize_from_h': -1,\n'seed_resize_from_w': -1,\n'steps': 90,\n'styles': [],\n'subseed': -1,\n'subseed_strength': 0,\n'tiling': False,\n'width': 1024}\nDone, you can find the picture in /src/output_img2img_1.png\n##########OUTPAINTING##########", "metrics": { "predict_time": 179.497469, "total_time": 338.136849 }, "output": "https://replicate.delivery/pbxt/4IwmMaioM6JeVigPjdJz9BbGRFzRc6D2iNsbsPXIfZaG70VSA/output_img2img_1.png", "started_at": "2024-02-12T04:18:28.787790Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/fjlklsdbe7zm4fq654dqmb52gm", "cancel": "https://api.replicate.com/v1/predictions/fjlklsdbe7zm4fq654dqmb52gm/cancel" }, "version": "935f34c9e2f435eb68cbd39b08f10e4ece78ec102850f935b7feae8a38aac982" }
Generated in##########CONVERT IMAGE########## Convert picture to JPEG and detect face in the picture... Done, you can find the picture in /tmp/new_picture.jpg ##########CONVERT IMAGE########## ##########FACE DETECTION########## Detecting face in the picture... 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 156ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 94ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 23ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 17ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 35ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 14ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 12ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 12ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 12ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 12ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 11ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 60ms/step 1/6 [====>.........................] - ETA: 6/6 [==============================] - 0s 3ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 105ms/step Done, the only one face is detected at the position {'x': 231, 'y': 221, 'width': 366, 'height': 516} ##########FACE DETECTION########## ##########OUTPAINTING########## Make a request to the API for outpainting the picture... Start the outpainting... The face is at the position with scare coord : {'x': -98, 'y': -33, 'width': 1024, 'height': 1024} The zone need outpainting is : {'top': 48, 'right': 0, 'bottom': 0, 'left': 112, 'json': ['up', 'left']} {'alwayson_scripts': {'ControlNet': {'args': [{'batch_images': '', 'control_mode': 'Balanced', 'enabled': False, 'guidance_end': 1, 'guidance_start': 0, 'image': None, 'input_mode': 'simple', 'is_ui': True, 'loopback': False, 'low_vram': False, 'model': 'None', 'module': 'none', 'output_dir': '', 'pixel_perfect': False, 'processor_res': -1, 'resize_mode': 'Crop and Resize', 'threshold_a': -1, 'threshold_b': -1, 'weight': 1}]}, 'Refiner': {'args': [False, '', 0.8]}, 'Seed': {'args': [1334, False, -1, 0, 0, 0]}}, 'batch_size': 1, 'cfg_scale': 7, 'comments': {}, 'denoising_strength': 0.95, 'disable_extra_networks': False, 'do_not_save_grid': True, 'do_not_save_samples': True, 'height': 1024, 'init_images': ['base64image placeholder'], 'initial_noise_multiplier': 1.0, 'inpaint_full_res': False, 'inpaint_full_res_padding': 32, 'inpainting_fill': 1, 'inpainting_mask_invert': 0, 'mask_blur': 32, 'mask_blur_x': 32, 'mask_blur_y': 32, 'n_iter': 1, 'negative_prompt': '', 'override_settings': {}, 'override_settings_restore_afterwards': True, 'prompt': '', 'resize_mode': 1, 'restore_faces': False, 's_churn': 0.0, 's_min_uncond': 0.0, 's_noise': 1.0, 's_tmax': None, 's_tmin': 0.0, 'sampler_name': 'Euler a', 'script_args': ['<p style="margin-bottom:0.75em">Recommended settings: ' 'Sampling Steps: 80-100, Sampler: Euler a, Denoising ' 'strength: 0.8</p>', 112, 8, ['up', 'left'], 1, 0.05], 'script_name': 'outpainting mk2', 'seed': 1334, 'seed_enable_extras': True, 'seed_resize_from_h': -1, 'seed_resize_from_w': -1, 'steps': 90, 'styles': [], 'subseed': -1, 'subseed_strength': 0, 'tiling': False, 'width': 1024} Done, you can find the picture in /src/output_img2img_1.png ##########OUTPAINTING##########
Prediction
zelenioncode/aicrop:fa06bed8b0ddeb21462b12ce89f2017046422225ca90ad80327ce41e34a577f5IDdrmhoplbdwvojen4yi26o67tm4StatusSucceededSourceWebHardwareA40 (Large)Total durationCreatedInput
{ "image": "https://replicate.delivery/pbxt/KO35ooRNHO4l9IbRP2bcmILzfApAVIVG4xGyTQp3rBvMvbon/t.jpeg" }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run zelenioncode/aicrop using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "zelenioncode/aicrop:fa06bed8b0ddeb21462b12ce89f2017046422225ca90ad80327ce41e34a577f5", { input: { image: "https://replicate.delivery/pbxt/KO35ooRNHO4l9IbRP2bcmILzfApAVIVG4xGyTQp3rBvMvbon/t.jpeg" } } ); // To access the file URL: console.log(output.url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run zelenioncode/aicrop using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "zelenioncode/aicrop:fa06bed8b0ddeb21462b12ce89f2017046422225ca90ad80327ce41e34a577f5", input={ "image": "https://replicate.delivery/pbxt/KO35ooRNHO4l9IbRP2bcmILzfApAVIVG4xGyTQp3rBvMvbon/t.jpeg" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Run zelenioncode/aicrop using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "version": "zelenioncode/aicrop:fa06bed8b0ddeb21462b12ce89f2017046422225ca90ad80327ce41e34a577f5", "input": { "image": "https://replicate.delivery/pbxt/KO35ooRNHO4l9IbRP2bcmILzfApAVIVG4xGyTQp3rBvMvbon/t.jpeg" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2024-02-11T20:23:16.403556Z", "created_at": "2024-02-11T20:17:58.666701Z", "data_removed": false, "error": null, "id": "drmhoplbdwvojen4yi26o67tm4", "input": { "image": "https://replicate.delivery/pbxt/KO35ooRNHO4l9IbRP2bcmILzfApAVIVG4xGyTQp3rBvMvbon/t.jpeg" }, "logs": "##########CONVERT IMAGE##########\nConvert picture to JPEG and detect face in the picture...\nDone, you can find the picture in /tmp/new_picture.jpg\n##########CONVERT IMAGE##########\n##########FACE DETECTION##########\nDetecting face in the picture...\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 147ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 89ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 21ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 37ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 14ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 12ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 61ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 11ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 11ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 10ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 11ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 11ms/step\n1/6 [====>.........................] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n6/6 [==============================] - 0s 2ms/step\n1/1 [==============================] - ETA: 0s\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\n1/1 [==============================] - 0s 102ms/step\nDone, the only one face is detected at the position {'x': 349, 'y': 251, 'width': 395, 'height': 524}\n##########FACE DETECTION##########\n##########OUTPAINTING##########\nMake a request to the API for outpainting the picture...\nStart the outpainting...\n{'alwayson_scripts': {'ControlNet': {'args': [{'batch_images': '',\n'control_mode': 'Balanced',\n'enabled': False,\n'guidance_end': 1,\n'guidance_start': 0,\n'image': None,\n'input_mode': 'simple',\n'is_ui': True,\n'loopback': False,\n'low_vram': False,\n'model': 'None',\n'module': 'none',\n'output_dir': '',\n 'pixel_perfect': False,\n'processor_res': -1,\n'resize_mode': 'Crop and Resize',\n'threshold_a': -1,\n'threshold_b': -1,\n'weight': 1}]},\n'Refiner': {'args': [False, '', 0.8]},\n'Seed': {'args': [1334, False, -1, 0, 0, 0]}},\n'batch_size': 1,\n'cfg_scale': 7,\n'comments': {},\n'denoising_strength': 0.95,\n'disable_extra_networks': False,\n'do_not_save_grid': True,\n'do_not_save_samples': True,\n'height': 1024,\n'init_images': ['base64image placeholder'],\n'initial_noise_multiplier': 1.0,\n'inpaint_full_res': False,\n'inpaint_full_res_padding': 32,\n'inpainting_fill': 1,\n'inpainting_mask_invert': 0,\n'mask_blur': 32,\n'mask_blur_x': 32,\n'mask_blur_y': 32,\n'n_iter': 1,\n'negative_prompt': '',\n'override_settings': {},\n'override_settings_restore_afterwards': True,\n'prompt': '',\n'resize_mode': 1,\n'restore_faces': False,\n's_churn': 0.0,\n's_min_uncond': 0.0,\n's_noise': 1.0,\n's_tmax': None,\n's_tmin': 0.0,\n'sampler_name': 'Euler a',\n'script_args': ['<p style=\"margin-bottom:0.75em\">Recommended settings: '\n'Sampling Steps: 80-100, Sampler: Euler a, Denoising '\n'strength: 0.8</p>',\n48,\n8,\n['right'],\n1,\n0.05],\n'script_name': 'outpainting mk2',\n'seed': 1334,\n'seed_enable_extras': True,\n'seed_resize_from_h': -1,\n'seed_resize_from_w': -1,\n'steps': 90,\n'styles': [],\n'subseed': -1,\n'subseed_strength': 0,\n'tiling': False,\n'width': 1024}\nDone, you can find the picture in /src/output_img2img_1.png\n##########OUTPAINTING##########", "metrics": { "predict_time": 118.124134, "total_time": 317.736855 }, "output": "https://replicate.delivery/pbxt/30BXz9wIET7JDhs14bzvx3FA2SjLustT0i9cfR056mDZ92KJA/output_img2img_1.png", "started_at": "2024-02-11T20:21:18.279422Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/drmhoplbdwvojen4yi26o67tm4", "cancel": "https://api.replicate.com/v1/predictions/drmhoplbdwvojen4yi26o67tm4/cancel" }, "version": "fa06bed8b0ddeb21462b12ce89f2017046422225ca90ad80327ce41e34a577f5" }
Generated in##########CONVERT IMAGE########## Convert picture to JPEG and detect face in the picture... Done, you can find the picture in /tmp/new_picture.jpg ##########CONVERT IMAGE########## ##########FACE DETECTION########## Detecting face in the picture... 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 147ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 89ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 21ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 37ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 14ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 12ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 61ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 11ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 11ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 10ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 11ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 11ms/step 1/6 [====>.........................] - ETA: 6/6 [==============================] - 0s 2ms/step 1/1 [==============================] - ETA: 1/1 [==============================] - 0s 102ms/step Done, the only one face is detected at the position {'x': 349, 'y': 251, 'width': 395, 'height': 524} ##########FACE DETECTION########## ##########OUTPAINTING########## Make a request to the API for outpainting the picture... Start the outpainting... {'alwayson_scripts': {'ControlNet': {'args': [{'batch_images': '', 'control_mode': 'Balanced', 'enabled': False, 'guidance_end': 1, 'guidance_start': 0, 'image': None, 'input_mode': 'simple', 'is_ui': True, 'loopback': False, 'low_vram': False, 'model': 'None', 'module': 'none', 'output_dir': '', 'pixel_perfect': False, 'processor_res': -1, 'resize_mode': 'Crop and Resize', 'threshold_a': -1, 'threshold_b': -1, 'weight': 1}]}, 'Refiner': {'args': [False, '', 0.8]}, 'Seed': {'args': [1334, False, -1, 0, 0, 0]}}, 'batch_size': 1, 'cfg_scale': 7, 'comments': {}, 'denoising_strength': 0.95, 'disable_extra_networks': False, 'do_not_save_grid': True, 'do_not_save_samples': True, 'height': 1024, 'init_images': ['base64image placeholder'], 'initial_noise_multiplier': 1.0, 'inpaint_full_res': False, 'inpaint_full_res_padding': 32, 'inpainting_fill': 1, 'inpainting_mask_invert': 0, 'mask_blur': 32, 'mask_blur_x': 32, 'mask_blur_y': 32, 'n_iter': 1, 'negative_prompt': '', 'override_settings': {}, 'override_settings_restore_afterwards': True, 'prompt': '', 'resize_mode': 1, 'restore_faces': False, 's_churn': 0.0, 's_min_uncond': 0.0, 's_noise': 1.0, 's_tmax': None, 's_tmin': 0.0, 'sampler_name': 'Euler a', 'script_args': ['<p style="margin-bottom:0.75em">Recommended settings: ' 'Sampling Steps: 80-100, Sampler: Euler a, Denoising ' 'strength: 0.8</p>', 48, 8, ['right'], 1, 0.05], 'script_name': 'outpainting mk2', 'seed': 1334, 'seed_enable_extras': True, 'seed_resize_from_h': -1, 'seed_resize_from_w': -1, 'steps': 90, 'styles': [], 'subseed': -1, 'subseed_strength': 0, 'tiling': False, 'width': 1024} Done, you can find the picture in /src/output_img2img_1.png ##########OUTPAINTING##########
Want to make some of these yourself?
Run this model