Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
digitaljohn /urban-narrative:ea830af4
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run digitaljohn/urban-narrative using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"digitaljohn/urban-narrative:ea830af4eeb1f0c3d9eb209ecbbc4ef14bcb8d51ac59b6d0a8dc2eb632a2fa84",
{
input: {
model: "schnell",
width: 1024,
height: 1024,
prompt: "an illustration of a couple looking at iphone on a london underground tube. text says \"LONDON PADDINGTON\"",
go_fast: false,
lora_scale: 1.2,
megapixels: "1",
num_outputs: 1,
aspect_ratio: "4:5",
output_format: "png",
guidance_scale: 3.5,
output_quality: 80,
prompt_strength: 0.8,
extra_lora_scale: 0.8,
num_inference_steps: 6
}
}
);
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run digitaljohn/urban-narrative using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"digitaljohn/urban-narrative:ea830af4eeb1f0c3d9eb209ecbbc4ef14bcb8d51ac59b6d0a8dc2eb632a2fa84",
input={
"model": "schnell",
"width": 1024,
"height": 1024,
"prompt": "an illustration of a couple looking at iphone on a london underground tube. text says \"LONDON PADDINGTON\"",
"go_fast": False,
"lora_scale": 1.2,
"megapixels": "1",
"num_outputs": 1,
"aspect_ratio": "4:5",
"output_format": "png",
"guidance_scale": 3.5,
"output_quality": 80,
"prompt_strength": 0.8,
"extra_lora_scale": 0.8,
"num_inference_steps": 6
}
)
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=<paste-your-token-here>
Find your API token in your account settings.
Run digitaljohn/urban-narrative 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": "digitaljohn/urban-narrative:ea830af4eeb1f0c3d9eb209ecbbc4ef14bcb8d51ac59b6d0a8dc2eb632a2fa84",
"input": {
"model": "schnell",
"width": 1024,
"height": 1024,
"prompt": "an illustration of a couple looking at iphone on a london underground tube. text says \\"LONDON PADDINGTON\\"",
"go_fast": false,
"lora_scale": 1.2,
"megapixels": "1",
"num_outputs": 1,
"aspect_ratio": "4:5",
"output_format": "png",
"guidance_scale": 3.5,
"output_quality": 80,
"prompt_strength": 0.8,
"extra_lora_scale": 0.8,
"num_inference_steps": 6
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2024-08-26T01:17:54.099502Z",
"created_at": "2024-08-26T01:17:51.925000Z",
"data_removed": false,
"error": null,
"id": "vf97ez65pnrm00chhh1ayfnr0c",
"input": {
"model": "schnell",
"width": 1024,
"height": 1024,
"prompt": "an illustration of a couple looking at iphone on a london underground tube. text says \"LONDON PADDINGTON\"",
"lora_scale": 1.2,
"num_outputs": 1,
"aspect_ratio": "4:5",
"output_format": "png",
"guidance_scale": 3.5,
"output_quality": 80,
"extra_lora_scale": 0.8,
"num_inference_steps": 6
},
"logs": "Using seed: 4259\nPrompt: an illustration of a couple looking at iphone on a london underground tube. text says \"LONDON PADDINGTON\"\ntxt2img mode\nUsing schnell model\nWeights already loaded\nLoaded LoRAs in 0.04s\n 0%| | 0/6 [00:00<?, ?it/s]\n 17%|█▋ | 1/6 [00:00<00:01, 4.03it/s]\n 33%|███▎ | 2/6 [00:00<00:00, 4.45it/s]\n 50%|█████ | 3/6 [00:00<00:00, 4.34it/s]\n 67%|██████▋ | 4/6 [00:00<00:00, 4.28it/s]\n 83%|████████▎ | 5/6 [00:01<00:00, 4.26it/s]\n100%|██████████| 6/6 [00:01<00:00, 4.24it/s]\n100%|██████████| 6/6 [00:01<00:00, 4.27it/s]",
"metrics": {
"predict_time": 2.163734393,
"total_time": 2.174502
},
"output": [
"https://replicate.delivery/yhqm/9l2iorXTie3IQKcf5r2daL8OoGzE5TkyyviOtHpS0LJBnYWTA/out-0.png"
],
"started_at": "2024-08-26T01:17:51.935767Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/vf97ez65pnrm00chhh1ayfnr0c",
"cancel": "https://api.replicate.com/v1/predictions/vf97ez65pnrm00chhh1ayfnr0c/cancel"
},
"version": "ea830af4eeb1f0c3d9eb209ecbbc4ef14bcb8d51ac59b6d0a8dc2eb632a2fa84"
}
Using seed: 4259
Prompt: an illustration of a couple looking at iphone on a london underground tube. text says "LONDON PADDINGTON"
txt2img mode
Using schnell model
Weights already loaded
Loaded LoRAs in 0.04s
0%| | 0/6 [00:00<?, ?it/s]
17%|█▋ | 1/6 [00:00<00:01, 4.03it/s]
33%|███▎ | 2/6 [00:00<00:00, 4.45it/s]
50%|█████ | 3/6 [00:00<00:00, 4.34it/s]
67%|██████▋ | 4/6 [00:00<00:00, 4.28it/s]
83%|████████▎ | 5/6 [00:01<00:00, 4.26it/s]
100%|██████████| 6/6 [00:01<00:00, 4.24it/s]
100%|██████████| 6/6 [00:01<00:00, 4.27it/s]