Skip to content

add replicate image provider#2806

Open
P3il4 wants to merge 4 commits intoHeyPuter:mainfrom
P3il4:replicate
Open

add replicate image provider#2806
P3il4 wants to merge 4 commits intoHeyPuter:mainfrom
P3il4:replicate

Conversation

@P3il4
Copy link
Copy Markdown
Contributor

@P3il4 P3il4 commented Apr 13, 2026

for now copied models list of cloudflare provider

  • supports pricing formats: per run, input/output mp, per image
  • follows "service:org/model" -> "org/model" + "model" alias rule
  • updated docs

testing:

await puter.ai.txt2img("Turn this into a watercolor painting", { model: "flux-2-pro", 
output_megapixels: 2,
input_images: ["img url here"] })
.then(img => document.body.appendChild(img))

cost keys examples:

"replicate:black-forest-labs/flux-2-pro:run": { // per-run
    "units": 1,
    "cost": 1500000,
    "count": 1
},
"replicate:black-forest-labs/flux-2-pro:output_mp": {
    "units": 2,
    "cost": 3000000,
    "count": 1
},
"replicate:black-forest-labs/flux-2-pro:input_mp": {
    "units": 3, // input mp costs use math.ceil as during testing a 2.25MP image was billed as 3MP input
    "cost": 4500000,
    "count": 1
},
"replicate:black-forest-labs/flux-1_dot_1-pro:output": { // per-image
    "units": 1,
    "cost": 4000000,
    "count": 1
}

tested with both real key and mock server
config.json setup (under services):

"replicate": {
    "apiKey": "key"
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant