typefile
{
"color_channel_shift": true,
"compression_quality": 20,
"glitch_intensity": 0.46,
"glitch_type": "datacorruption",
"image": "https://replicate.delivery/pbxt/NWVPFSLUjp0PGV5Qtsqoo63gQgiCBLsfdsh3Tmhow1P4C4jf/out-4.jpg"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_asy**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run andreasjansson/jpg-glitch using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
color_channel_shift: true,
compression_quality: 20,
glitch_intensity: 0.46,
glitch_type: "datacorruption",
image: "https://replicate.delivery/pbxt/NWVPFSLUjp0PGV5Qtsqoo63gQgiCBLsfdsh3Tmhow1P4C4jf/out-4.jpg"
};
const output = await replicate.run("andreasjansson/jpg-glitch", { input });
// 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.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_asy**********************************
This is your API token. Keep it to yourself.
import replicate
Run andreasjansson/jpg-glitch using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"andreasjansson/jpg-glitch",
input={
"color_channel_shift": True,
"compression_quality": 20,
"glitch_intensity": 0.46,
"glitch_type": "datacorruption",
"image": "https://replicate.delivery/pbxt/NWVPFSLUjp0PGV5Qtsqoo63gQgiCBLsfdsh3Tmhow1P4C4jf/out-4.jpg"
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_asy**********************************
This is your API token. Keep it to yourself.
Run andreasjansson/jpg-glitch 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 $'{
"input": {
"color_channel_shift": true,
"compression_quality": 20,
"glitch_intensity": 0.46,
"glitch_type": "datacorruption",
"image": "https://replicate.delivery/pbxt/NWVPFSLUjp0PGV5Qtsqoo63gQgiCBLsfdsh3Tmhow1P4C4jf/out-4.jpg"
}
}' \
https://api.replicate.com/v1/models/andreasjansson/jpg-glitch/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "hqs1k073jdrmc0crkwkajncfkr",
"model": "andreasjansson/jpg-glitch",
"version": "hidden",
"input": {
"color_channel_shift": true,
"compression_quality": 20,
"glitch_intensity": 0.46,
"glitch_type": "datacorruption",
"image": "https://replicate.delivery/pbxt/NWVPFSLUjp0PGV5Qtsqoo63gQgiCBLsfdsh3Tmhow1P4C4jf/out-4.jpg"
},
"logs": "",
"output": "https://replicate.delivery/xezq/c5KkwkiDvZJ6CVhW5XDYEAR8poqymRXx2rIGoxH1WE3TgkSF/glitched.jpg",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-08-12T16:39:42.739Z",
"started_at": "2025-08-12T16:39:43.033244Z",
"completed_at": "2025-08-12T16:39:43.186666Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/hqs1k073jdrmc0crkwkajncfkr/cancel",
"children": "https://api.replicate.com/v1/predictions/hqs1k073jdrmc0crkwkajncfkr/children",
"get": "https://api.replicate.com/v1/predictions/hqs1k073jdrmc0crkwkajncfkr",
"root": "https://api.replicate.com/v1/predictions/hqs1k073jdrmc0crkwkajncfkr",
"stream": "https://stream.replicate.com/v1/files/bcwr-thu7unkgdupr2m6ay55n5yrnjctmudgorwhygebhlknbjsdwhsna",
"web": "https://replicate.com/p/hqs1k073jdrmc0crkwkajncfkr"
},
"metrics": {
"predict_time": 0.15342181,
"total_time": 0.447666
}
}
