typetext
{
"cfg_img_scale": 2,
"cfg_renorm_min": 1,
"cfg_renorm_type": "text_channel",
"cfg_text_scale": 4,
"enable_thinking": false,
"image": "https://replicate.delivery/pbxt/N3j6lENyFDxARhorZ8yY86qhIF1uMuvEMO1KytosXUxaz0EO/image.png",
"num_inference_steps": 50,
"output_format": "webp",
"output_quality": 90,
"prompt": "She boards a modern London Tube, quietly reading a folded newspaper, wearing the same clothes",
"task": "image-editing",
"timestep_shift": 3
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Bf0**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run bytedance/bagel using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"bytedance/bagel:7dd8def79e503990740db4704fa81af995d440fefe714958531d7044d2757c9c",
{
input: {
cfg_img_scale: 2,
cfg_renorm_min: 1,
cfg_renorm_type: "text_channel",
cfg_text_scale: 4,
enable_thinking: false,
image: "https://replicate.delivery/pbxt/N3j6lENyFDxARhorZ8yY86qhIF1uMuvEMO1KytosXUxaz0EO/image.png",
num_inference_steps: 50,
output_format: "webp",
output_quality: 90,
prompt: "She boards a modern London Tube, quietly reading a folded newspaper, wearing the same clothes",
task: "image-editing",
timestep_shift: 3
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Bf0**********************************
This is your API token. Keep it to yourself.
import replicate
Run bytedance/bagel using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"bytedance/bagel:7dd8def79e503990740db4704fa81af995d440fefe714958531d7044d2757c9c",
input={
"cfg_img_scale": 2,
"cfg_renorm_min": 1,
"cfg_renorm_type": "text_channel",
"cfg_text_scale": 4,
"enable_thinking": False,
"image": "https://replicate.delivery/pbxt/N3j6lENyFDxARhorZ8yY86qhIF1uMuvEMO1KytosXUxaz0EO/image.png",
"num_inference_steps": 50,
"output_format": "webp",
"output_quality": 90,
"prompt": "She boards a modern London Tube, quietly reading a folded newspaper, wearing the same clothes",
"task": "image-editing",
"timestep_shift": 3
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Bf0**********************************
This is your API token. Keep it to yourself.
Run bytedance/bagel 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": "bytedance/bagel:7dd8def79e503990740db4704fa81af995d440fefe714958531d7044d2757c9c",
"input": {
"cfg_img_scale": 2,
"cfg_renorm_min": 1,
"cfg_renorm_type": "text_channel",
"cfg_text_scale": 4,
"enable_thinking": false,
"image": "https://replicate.delivery/pbxt/N3j6lENyFDxARhorZ8yY86qhIF1uMuvEMO1KytosXUxaz0EO/image.png",
"num_inference_steps": 50,
"output_format": "webp",
"output_quality": 90,
"prompt": "She boards a modern London Tube, quietly reading a folded newspaper, wearing the same clothes",
"task": "image-editing",
"timestep_shift": 3
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Object output with 1 properties
{
"id": "z280hgxyxdrme0cpzp4ab5dy5w",
"model": "bytedance/bagel",
"version": "7dd8def79e503990740db4704fa81af995d440fefe714958531d7044d2757c9c",
"input": {
"cfg_img_scale": 2,
"cfg_renorm_min": 1,
"cfg_renorm_type": "text_channel",
"cfg_text_scale": 4,
"enable_thinking": false,
"image": "https://replicate.delivery/pbxt/N3j6lENyFDxARhorZ8yY86qhIF1uMuvEMO1KytosXUxaz0EO/image.png",
"num_inference_steps": 50,
"output_format": "webp",
"output_quality": 90,
"prompt": "She boards a modern London Tube, quietly reading a folded newspaper, wearing the same clothes",
"task": "image-editing",
"timestep_shift": 3
},
"logs": "[+] Using seed: 60309\n[+] Loaded input image: (1534, 1968)\n[+] Running image editing\n[+] Processing prompt: She boards a modern London Tube, quietly reading a folded newspaper, wearing the same clothes\n[+] Generated 800x1024 image saved as WEBP",
"output": {
"image": "https://replicate.delivery/xezq/KWWpk9oeorSXJKisnvRRdSgxif9d06XNC1zAi2sreWeJ6NelC/output.webp",
"text": null
},
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-05-23T14:25:19.595Z",
"started_at": "2025-05-23T14:25:28.677604Z",
"completed_at": "2025-05-23T14:26:42.612331Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/z280hgxyxdrme0cpzp4ab5dy5w/cancel",
"get": "https://api.replicate.com/v1/predictions/z280hgxyxdrme0cpzp4ab5dy5w",
"web": "https://replicate.com/p/z280hgxyxdrme0cpzp4ab5dy5w"
},
"metrics": {
"predict_time": 73.934726825,
"total_time": 83.017331
}
}
