Replicate · Run a model runs a model hosted on Replicate — for images, audio, video or text — on your company's own Replicate account. You choose the model, and its inputs appear as rows to fill in. The step waits up to a minute for the result and passes it on; files the model makes become files on the run. Get a prediction reads a run that is still going, or one started elsewhere.

Who can do this

Workspace Admins and Editors, on every plan.

Before you start

A Replicate connection in Connections — see Connect Replicate.

Steps

Run a model:

  1. Select + where the model should run. In the step picker, open AI, then Replicate, and select Run a model.
  2. In Connection, choose the connection.
  3. In Model, choose one of Replicate's official models from the list, or select Use a value and type the model's name as Replicate shows it, owner/name — for example black-forest-labs/flux-schnell.
  4. Leave Version empty for the latest version, or choose one to pin. A pinned version keeps giving the same kind of result when the owner changes the model.
  5. Under Inputs, fill in the rows. They are read from the model's own description: under each name, its type — text, number, true or false, one of a list, a file — and what it is for. Required ones come first; leave a row empty to use the model's own default. Use values from earlier steps in {{ }}; for a file input, drag in a file from an earlier step. See Pass files between steps.
  6. Select Run this step. A value of the wrong type stops the step before anything runs, naming the input — Steps › Input 'steps' must be a number.

Get a prediction:

  1. In the step picker, under Replicate, select Get a prediction, and choose the Connection.
  2. In Prediction ID, the id from an earlier step — {{ $json.id }}.
  3. Select Run this step.

Output

Both steps give id, status (succeeded, failed, canceled, starting or processing), output (what the model gave back, as the model gives it — text, a list, an object), files (each file the model made, as a file on the run), error (when it failed) and usage. usage holds model, version, predictSeconds (how long the model ran, which is what Replicate bills) and seconds. Output shows them as the usage strip.

A model that makes one image gives one file in files; drag it into a later step's File or Attachments from Data from earlier steps. Up to 20 files are kept from one run.

Good to know

  • Waiting. The step asks Replicate to answer as soon as the result is ready, and waits up to 60 seconds. A model that takes longer does not fail the step: it succeeds with status processing and the id, and the model keeps running on Replicate. Add Wait and Get a prediction after it, with the id.
  • A cold model — one nobody has run for a while — can take a minute or more to start, and Replicate bills the start-up time on some models.
  • Each item is a separate run, and a separate cost. Each test run costs again; pin the output once it is right — see Pin a step's output.
  • Models change. An owner can change a model's inputs on Latest; pin a version for a workflow that must keep working.
  • Private models of your own account run the same way — type their owner/name.
  • A step may take up to five minutes in all, including keeping the files the model made.

If something goes wrong

What the run says Why What to do
Replicate refused: … Check the connection's details on Connections. The token is wrong or revoked. Replace the token on Connections.
Replicate refused: … Too many at once, the account is out of credit, or an input Replicate will not take. It is not tried again. Read Replicate's reason; set up billing, check the Inputs rows, or set the step to try again.
Steps › Input 'steps' must be a number A row holds a value of the wrong type — here, text where the model wants a number. Correct the row, or the value from the earlier step.
Prompt › Input 'prompt' is required. Fill it in under Inputs. A required row is empty. Fill it in.
Model “…” is not owner/name, as Replicate shows it — black-forest-labs/flux-schnell. Model is not in that form. Type it as Replicate shows it.
Replicate could not find the model … The name is mistyped, or the model is private to another account. Check owner/name on Replicate.
The model has no input named '…' now. Refresh the inputs and fill them in again. The owner changed the model's inputs on the latest version. Refresh Inputs, or pin a version.
status failed, with error The model itself failed. Read error; check the inputs, or try another version.
Could not reach Replicate: … / Replicate did not answer within 5 minutes. Replicate could not be reached. Try again.