pixray / text2image

Uses pixray to generate an image from text prompt

  • Public
  • 1.4M runs
  • T4
  • GitHub
  • License

Run pixray/text2image with an API

Use one of our client libraries to get started quickly.

Set the REPLICATE_API_TOKEN environment variable

export REPLICATE_API_TOKEN=<paste-your-token-here>

Learn more about authentication

Install Replicate’s Node.js client library

npm install replicate
Learn more about setup

Run pixray/text2image using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.

import Replicate from "replicate";
const replicate = new Replicate();

const input = {
    prompts: "Manhattan skyline at sunset. #artstation 🌇"
};

for await (const event of replicate.stream("pixray/text2image:5c347a4bfa1d4523a58ae614c2194e15f2ae682b57e3797a5bb468920aa70ebf", { input })) {
  process.stdout.write(`${event}
`)
  //=> {"file":"https://replicate.delivery/mgxm/7d3e3aa2-9859-4679-9755-5c8c166c9aae/tempfile.png"}
};
process.stdout.write("\n");
Learn more