dhanushreddy291 / photo-background-generation
Generate Product photography backgrounds using Stable Diffusion
Prediction
dhanushreddy291/photo-background-generation:1db5ee211d65558d3fd11fc60bc00073f300d7a3a0b5abbfafbd20239ac58d2fIDwv7t4cxxk9rgm0cg3bws0708a8StatusSucceededSourceWebHardwareA40Total durationCreatedInput
- prompt
- A Shoe on a marble podium, product photography, high resolution
- num_outputs
- 1
- negative_prompt
- 3d, cgi, render, bad quality, normal quality
- num_inference_steps
- 30
- controlnet_conditioning_scale
- 1
{ "image": "https://unsplash.com/photos/AYIeSFWhEB8/download?force=true&w=640", "prompt": "A Shoe on a marble podium, product photography, high resolution", "num_outputs": 1, "negative_prompt": "3d, cgi, render, bad quality, normal quality", "num_inference_steps": 30, "controlnet_conditioning_scale": 1 }
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 dhanushreddy291/photo-background-generation using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "dhanushreddy291/photo-background-generation:1db5ee211d65558d3fd11fc60bc00073f300d7a3a0b5abbfafbd20239ac58d2f", { input: { image: "https://unsplash.com/photos/AYIeSFWhEB8/download?force=true&w=640", prompt: "A Shoe on a marble podium, product photography, high resolution", num_outputs: 1, negative_prompt: "3d, cgi, render, bad quality, normal quality", num_inference_steps: 30, controlnet_conditioning_scale: 1 } } ); // To access the file URL: console.log(output[0].url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output[0]);
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 dhanushreddy291/photo-background-generation using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "dhanushreddy291/photo-background-generation:1db5ee211d65558d3fd11fc60bc00073f300d7a3a0b5abbfafbd20239ac58d2f", input={ "image": "https://unsplash.com/photos/AYIeSFWhEB8/download?force=true&w=640", "prompt": "A Shoe on a marble podium, product photography, high resolution", "num_outputs": 1, "negative_prompt": "3d, cgi, render, bad quality, normal quality", "num_inference_steps": 30, "controlnet_conditioning_scale": 1 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Run dhanushreddy291/photo-background-generation 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": "dhanushreddy291/photo-background-generation:1db5ee211d65558d3fd11fc60bc00073f300d7a3a0b5abbfafbd20239ac58d2f", "input": { "image": "https://unsplash.com/photos/AYIeSFWhEB8/download?force=true&w=640", "prompt": "A Shoe on a marble podium, product photography, high resolution", "num_outputs": 1, "negative_prompt": "3d, cgi, render, bad quality, normal quality", "num_inference_steps": 30, "controlnet_conditioning_scale": 1 } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2024-06-15T08:20:23.483619Z", "created_at": "2024-06-15T08:18:13.018000Z", "data_removed": false, "error": null, "id": "wv7t4cxxk9rgm0cg3bws0708a8", "input": { "image": "https://unsplash.com/photos/AYIeSFWhEB8/download?force=true&w=640", "prompt": "A Shoe on a marble podium, product photography, high resolution", "num_outputs": 1, "negative_prompt": "3d, cgi, render, bad quality, normal quality", "num_inference_steps": 30, "controlnet_conditioning_scale": 1 }, "logs": "Using seed: 11152876\n/root/.pyenv/versions/3.10.14/lib/python3.10/site-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3190.)\nreturn _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]\nSettings -> Mode=base, Device=cuda:0, Torchscript=disabled\nSettings -> Mode=base, Device=cuda:0, Torchscript=disabled\n 0%| | 0/30 [00:00<?, ?it/s]\n 3%|▎ | 1/30 [00:00<00:04, 6.87it/s]\n 10%|█ | 3/30 [00:00<00:03, 8.11it/s]\n 17%|█▋ | 5/30 [00:00<00:02, 9.38it/s]\n 23%|██▎ | 7/30 [00:00<00:02, 10.02it/s]\n 30%|███ | 9/30 [00:00<00:02, 10.38it/s]\n 37%|███▋ | 11/30 [00:01<00:01, 10.60it/s]\n 43%|████▎ | 13/30 [00:01<00:01, 10.72it/s]\n 50%|█████ | 15/30 [00:01<00:01, 10.79it/s]\n 57%|█████▋ | 17/30 [00:01<00:01, 10.86it/s]\n 63%|██████▎ | 19/30 [00:01<00:01, 10.92it/s]\n 70%|███████ | 21/30 [00:02<00:00, 10.96it/s]\n 77%|███████▋ | 23/30 [00:02<00:00, 10.97it/s]\n 83%|████████▎ | 25/30 [00:02<00:00, 10.98it/s]\n 90%|█████████ | 27/30 [00:02<00:00, 11.00it/s]\n 97%|█████████▋| 29/30 [00:02<00:00, 11.01it/s]\n100%|██████████| 30/30 [00:02<00:00, 10.61it/s]", "metrics": { "predict_time": 10.733520402, "total_time": 130.465619 }, "output": [ "https://replicate.delivery/pbxt/b8wxAZmKEmJ0NVXe7ckd7v3uvOOriLwg5HieLpU8RYkGDwelA/out-0.png" ], "started_at": "2024-06-15T08:20:12.750099Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/wv7t4cxxk9rgm0cg3bws0708a8", "cancel": "https://api.replicate.com/v1/predictions/wv7t4cxxk9rgm0cg3bws0708a8/cancel" }, "version": "1db5ee211d65558d3fd11fc60bc00073f300d7a3a0b5abbfafbd20239ac58d2f" }
Generated inUsing seed: 11152876 /root/.pyenv/versions/3.10.14/lib/python3.10/site-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3190.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] Settings -> Mode=base, Device=cuda:0, Torchscript=disabled Settings -> Mode=base, Device=cuda:0, Torchscript=disabled 0%| | 0/30 [00:00<?, ?it/s] 3%|▎ | 1/30 [00:00<00:04, 6.87it/s] 10%|█ | 3/30 [00:00<00:03, 8.11it/s] 17%|█▋ | 5/30 [00:00<00:02, 9.38it/s] 23%|██▎ | 7/30 [00:00<00:02, 10.02it/s] 30%|███ | 9/30 [00:00<00:02, 10.38it/s] 37%|███▋ | 11/30 [00:01<00:01, 10.60it/s] 43%|████▎ | 13/30 [00:01<00:01, 10.72it/s] 50%|█████ | 15/30 [00:01<00:01, 10.79it/s] 57%|█████▋ | 17/30 [00:01<00:01, 10.86it/s] 63%|██████▎ | 19/30 [00:01<00:01, 10.92it/s] 70%|███████ | 21/30 [00:02<00:00, 10.96it/s] 77%|███████▋ | 23/30 [00:02<00:00, 10.97it/s] 83%|████████▎ | 25/30 [00:02<00:00, 10.98it/s] 90%|█████████ | 27/30 [00:02<00:00, 11.00it/s] 97%|█████████▋| 29/30 [00:02<00:00, 11.01it/s] 100%|██████████| 30/30 [00:02<00:00, 10.61it/s]
Prediction
dhanushreddy291/photo-background-generation:1db5ee211d65558d3fd11fc60bc00073f300d7a3a0b5abbfafbd20239ac58d2fID9e8drj3cydrgg0cg3c08ck3a68StatusSucceededSourceWebHardwareA40Total durationCreatedInput
- prompt
- A Shoe on a marble podium, product photography, high resolution
- num_outputs
- 4
- negative_prompt
- 3d, cgi, render, bad quality, normal quality
- num_inference_steps
- 30
- controlnet_conditioning_scale
- 1
{ "image": "https://unsplash.com/photos/n2V5MLDPE-k/download?force=true&w=640", "prompt": "A Shoe on a marble podium, product photography, high resolution", "num_outputs": 4, "negative_prompt": "3d, cgi, render, bad quality, normal quality", "num_inference_steps": 30, "controlnet_conditioning_scale": 1 }
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 dhanushreddy291/photo-background-generation using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "dhanushreddy291/photo-background-generation:1db5ee211d65558d3fd11fc60bc00073f300d7a3a0b5abbfafbd20239ac58d2f", { input: { image: "https://unsplash.com/photos/n2V5MLDPE-k/download?force=true&w=640", prompt: "A Shoe on a marble podium, product photography, high resolution", num_outputs: 4, negative_prompt: "3d, cgi, render, bad quality, normal quality", num_inference_steps: 30, controlnet_conditioning_scale: 1 } } ); // To access the file URL: console.log(output[0].url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output[0]);
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 dhanushreddy291/photo-background-generation using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "dhanushreddy291/photo-background-generation:1db5ee211d65558d3fd11fc60bc00073f300d7a3a0b5abbfafbd20239ac58d2f", input={ "image": "https://unsplash.com/photos/n2V5MLDPE-k/download?force=true&w=640", "prompt": "A Shoe on a marble podium, product photography, high resolution", "num_outputs": 4, "negative_prompt": "3d, cgi, render, bad quality, normal quality", "num_inference_steps": 30, "controlnet_conditioning_scale": 1 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Run dhanushreddy291/photo-background-generation 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": "dhanushreddy291/photo-background-generation:1db5ee211d65558d3fd11fc60bc00073f300d7a3a0b5abbfafbd20239ac58d2f", "input": { "image": "https://unsplash.com/photos/n2V5MLDPE-k/download?force=true&w=640", "prompt": "A Shoe on a marble podium, product photography, high resolution", "num_outputs": 4, "negative_prompt": "3d, cgi, render, bad quality, normal quality", "num_inference_steps": 30, "controlnet_conditioning_scale": 1 } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2024-06-15T08:27:15.097148Z", "created_at": "2024-06-15T08:25:31.123000Z", "data_removed": false, "error": null, "id": "9e8drj3cydrgg0cg3c08ck3a68", "input": { "image": "https://unsplash.com/photos/n2V5MLDPE-k/download?force=true&w=640", "prompt": "A Shoe on a marble podium, product photography, high resolution", "num_outputs": 4, "negative_prompt": "3d, cgi, render, bad quality, normal quality", "num_inference_steps": 30, "controlnet_conditioning_scale": 1 }, "logs": "Using seed: 9098225\n/root/.pyenv/versions/3.10.14/lib/python3.10/site-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3190.)\nreturn _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]\nSettings -> Mode=base, Device=cuda:0, Torchscript=disabled\nSettings -> Mode=base, Device=cuda:0, Torchscript=disabled\n 0%| | 0/30 [00:00<?, ?it/s]\n 3%|▎ | 1/30 [00:00<00:09, 3.02it/s]\n 7%|▋ | 2/30 [00:00<00:08, 3.17it/s]\n 10%|█ | 3/30 [00:01<00:09, 2.94it/s]\n 13%|█▎ | 4/30 [00:01<00:08, 3.06it/s]\n 17%|█▋ | 5/30 [00:01<00:07, 3.14it/s]\n 20%|██ | 6/30 [00:01<00:07, 3.18it/s]\n 23%|██▎ | 7/30 [00:02<00:07, 3.21it/s]\n 27%|██▋ | 8/30 [00:02<00:06, 3.23it/s]\n 30%|███ | 9/30 [00:02<00:06, 3.25it/s]\n 33%|███▎ | 10/30 [00:03<00:06, 3.26it/s]\n 37%|███▋ | 11/30 [00:03<00:05, 3.26it/s]\n 40%|████ | 12/30 [00:03<00:05, 3.27it/s]\n 43%|████▎ | 13/30 [00:04<00:05, 3.27it/s]\n 47%|████▋ | 14/30 [00:04<00:04, 3.27it/s]\n 50%|█████ | 15/30 [00:04<00:04, 3.27it/s]\n 53%|█████▎ | 16/30 [00:04<00:04, 3.28it/s]\n 57%|█████▋ | 17/30 [00:05<00:03, 3.28it/s]\n 60%|██████ | 18/30 [00:05<00:03, 3.28it/s]\n 63%|██████▎ | 19/30 [00:05<00:03, 3.27it/s]\n 67%|██████▋ | 20/30 [00:06<00:03, 3.27it/s]\n 70%|███████ | 21/30 [00:06<00:02, 3.27it/s]\n 73%|███████▎ | 22/30 [00:06<00:02, 3.27it/s]\n 77%|███████▋ | 23/30 [00:07<00:02, 3.27it/s]\n 80%|████████ | 24/30 [00:07<00:01, 3.27it/s]\n 83%|████████▎ | 25/30 [00:07<00:01, 3.27it/s]\n 87%|████████▋ | 26/30 [00:08<00:01, 3.27it/s]\n 90%|█████████ | 27/30 [00:08<00:00, 3.27it/s]\n 93%|█████████▎| 28/30 [00:08<00:00, 3.27it/s]\n 97%|█████████▋| 29/30 [00:08<00:00, 3.27it/s]\n100%|██████████| 30/30 [00:09<00:00, 3.27it/s]\n100%|██████████| 30/30 [00:09<00:00, 3.24it/s]", "metrics": { "predict_time": 16.84737275, "total_time": 103.974148 }, "output": [ "https://replicate.delivery/pbxt/rf9mpEopim0NBSjKlLU8Jf429JCjvFHunQKL3h3RG4liJwelA/out-0.png", "https://replicate.delivery/pbxt/wTYQOBaPvr5uCFbSZY17tSJ8T3fkeGi5N9OoQ8CFHJEiJwelA/out-1.png", "https://replicate.delivery/pbxt/R9isCTG1GF6VE9HTpo0B0LL4yehEKrE9OoofUHfpZjBFTg9lA/out-2.png", "https://replicate.delivery/pbxt/95GBSozaIMJ2B9OOtkDkXV5O0rHD8BEW2IwTUN6EJdtYCsvE/out-3.png" ], "started_at": "2024-06-15T08:26:58.249775Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/9e8drj3cydrgg0cg3c08ck3a68", "cancel": "https://api.replicate.com/v1/predictions/9e8drj3cydrgg0cg3c08ck3a68/cancel" }, "version": "1db5ee211d65558d3fd11fc60bc00073f300d7a3a0b5abbfafbd20239ac58d2f" }
Generated inUsing seed: 9098225 /root/.pyenv/versions/3.10.14/lib/python3.10/site-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3190.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] Settings -> Mode=base, Device=cuda:0, Torchscript=disabled Settings -> Mode=base, Device=cuda:0, Torchscript=disabled 0%| | 0/30 [00:00<?, ?it/s] 3%|▎ | 1/30 [00:00<00:09, 3.02it/s] 7%|▋ | 2/30 [00:00<00:08, 3.17it/s] 10%|█ | 3/30 [00:01<00:09, 2.94it/s] 13%|█▎ | 4/30 [00:01<00:08, 3.06it/s] 17%|█▋ | 5/30 [00:01<00:07, 3.14it/s] 20%|██ | 6/30 [00:01<00:07, 3.18it/s] 23%|██▎ | 7/30 [00:02<00:07, 3.21it/s] 27%|██▋ | 8/30 [00:02<00:06, 3.23it/s] 30%|███ | 9/30 [00:02<00:06, 3.25it/s] 33%|███▎ | 10/30 [00:03<00:06, 3.26it/s] 37%|███▋ | 11/30 [00:03<00:05, 3.26it/s] 40%|████ | 12/30 [00:03<00:05, 3.27it/s] 43%|████▎ | 13/30 [00:04<00:05, 3.27it/s] 47%|████▋ | 14/30 [00:04<00:04, 3.27it/s] 50%|█████ | 15/30 [00:04<00:04, 3.27it/s] 53%|█████▎ | 16/30 [00:04<00:04, 3.28it/s] 57%|█████▋ | 17/30 [00:05<00:03, 3.28it/s] 60%|██████ | 18/30 [00:05<00:03, 3.28it/s] 63%|██████▎ | 19/30 [00:05<00:03, 3.27it/s] 67%|██████▋ | 20/30 [00:06<00:03, 3.27it/s] 70%|███████ | 21/30 [00:06<00:02, 3.27it/s] 73%|███████▎ | 22/30 [00:06<00:02, 3.27it/s] 77%|███████▋ | 23/30 [00:07<00:02, 3.27it/s] 80%|████████ | 24/30 [00:07<00:01, 3.27it/s] 83%|████████▎ | 25/30 [00:07<00:01, 3.27it/s] 87%|████████▋ | 26/30 [00:08<00:01, 3.27it/s] 90%|█████████ | 27/30 [00:08<00:00, 3.27it/s] 93%|█████████▎| 28/30 [00:08<00:00, 3.27it/s] 97%|█████████▋| 29/30 [00:08<00:00, 3.27it/s] 100%|██████████| 30/30 [00:09<00:00, 3.27it/s] 100%|██████████| 30/30 [00:09<00:00, 3.24it/s]
Want to make some of these yourself?
Run this model