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 man looking at iphone on a london underground tube",
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 man looking at iphone on a london underground tube",
"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 man looking at iphone on a london underground tube",
"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.
brew install cog
If you don’t have Homebrew, there are other installation options available.
Run this to download the model and run it in your local environment:
cog predict r8.im/digitaljohn/urban-narrative@sha256:ea830af4eeb1f0c3d9eb209ecbbc4ef14bcb8d51ac59b6d0a8dc2eb632a2fa84 \
-i 'model="schnell"' \
-i 'width=1024' \
-i 'height=1024' \
-i 'prompt="an illustration of a man looking at iphone on a london underground tube"' \
-i 'go_fast=false' \
-i 'lora_scale=1.2' \
-i 'megapixels="1"' \
-i 'num_outputs=1' \
-i 'aspect_ratio="4:5"' \
-i 'output_format="png"' \
-i 'guidance_scale=3.5' \
-i 'output_quality=80' \
-i 'prompt_strength=0.8' \
-i 'extra_lora_scale=0.8' \
-i 'num_inference_steps=6'
To learn more, take a look at the Cog documentation.
Run this to download the model and run it in your local environment:
docker run -d -p 5000:5000 --gpus=all r8.im/digitaljohn/urban-narrative@sha256:ea830af4eeb1f0c3d9eb209ecbbc4ef14bcb8d51ac59b6d0a8dc2eb632a2fa84
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "model": "schnell", "width": 1024, "height": 1024, "prompt": "an illustration of a man looking at iphone on a london underground tube", "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 } }' \ http://localhost:5000/predictions
To learn more, take a look at the Cog documentation.
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:16:12.147177Z",
"created_at": "2024-08-26T01:16:01.259000Z",
"data_removed": false,
"error": null,
"id": "hwav9e8nddrm40chhh0vv7dnz4",
"input": {
"model": "schnell",
"width": 1024,
"height": 1024,
"prompt": "an illustration of a man looking at iphone on a london underground tube",
"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: 37732\nPrompt: an illustration of a man looking at iphone on a london underground tube\ntxt2img mode\nUsing schnell model\nLoaded LoRAs in 8.81s\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.46it/s]\n 50%|█████ | 3/6 [00:00<00:00, 4.35it/s]\n 67%|██████▋ | 4/6 [00:00<00:00, 4.30it/s]\n 83%|████████▎ | 5/6 [00:01<00:00, 4.27it/s]\n100%|██████████| 6/6 [00:01<00:00, 4.25it/s]\n100%|██████████| 6/6 [00:01<00:00, 4.27it/s]",
"metrics": {
"predict_time": 10.877751312000001,
"total_time": 10.888177
},
"output": [
"https://replicate.delivery/yhqm/pl4gDsLWz5JnJ5PboP0tv3ganJsIQYAExOQq4XDw7k3WJm1E/out-0.png"
],
"started_at": "2024-08-26T01:16:01.269426Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/hwav9e8nddrm40chhh0vv7dnz4",
"cancel": "https://api.replicate.com/v1/predictions/hwav9e8nddrm40chhh0vv7dnz4/cancel"
},
"version": "ea830af4eeb1f0c3d9eb209ecbbc4ef14bcb8d51ac59b6d0a8dc2eb632a2fa84"
}
Using seed: 37732
Prompt: an illustration of a man looking at iphone on a london underground tube
txt2img mode
Using schnell model
Loaded LoRAs in 8.81s
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.46it/s]
50%|█████ | 3/6 [00:00<00:00, 4.35it/s]
67%|██████▋ | 4/6 [00:00<00:00, 4.30it/s]
83%|████████▎ | 5/6 [00:01<00:00, 4.27it/s]
100%|██████████| 6/6 [00:01<00:00, 4.25it/s]
100%|██████████| 6/6 [00:01<00:00, 4.27it/s]