typetext
{
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"guidance_scale": 6.04,
"lora_scale": 0.9,
"model": "dev",
"num_inference_steps": 32,
"num_outputs": 1,
"output_format": "png",
"output_quality": 90,
"prompt": "photo of JONSHUBJAM2 a bald man as a medieval knight.",
"prompt_strength": 0.8
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_3Ds**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run jonathan-hubjam/jonathan-flux2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"jonathan-hubjam/jonathan-flux2:9c9c3fc64279fe816ffbfd86d01b28ddcbe273e88fe5ee8e9d1cad5995d7be7a",
{
input: {
aspect_ratio: "1:1",
extra_lora_scale: 1,
guidance_scale: 6.04,
lora_scale: 0.9,
model: "dev",
num_inference_steps: 32,
num_outputs: 1,
output_format: "png",
output_quality: 90,
prompt: "photo of JONSHUBJAM2 a bald man as a medieval knight.",
prompt_strength: 0.8
}
}
);
// 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=r8_3Ds**********************************
This is your API token. Keep it to yourself.
import replicate
Run jonathan-hubjam/jonathan-flux2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"jonathan-hubjam/jonathan-flux2:9c9c3fc64279fe816ffbfd86d01b28ddcbe273e88fe5ee8e9d1cad5995d7be7a",
input={
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"guidance_scale": 6.04,
"lora_scale": 0.9,
"model": "dev",
"num_inference_steps": 32,
"num_outputs": 1,
"output_format": "png",
"output_quality": 90,
"prompt": "photo of JONSHUBJAM2 a bald man as a medieval knight.",
"prompt_strength": 0.8
}
)
# To access the file URL:
print(output[0].url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output[0].read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_3Ds**********************************
This is your API token. Keep it to yourself.
Run jonathan-hubjam/jonathan-flux2 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": "jonathan-hubjam/jonathan-flux2:9c9c3fc64279fe816ffbfd86d01b28ddcbe273e88fe5ee8e9d1cad5995d7be7a",
"input": {
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"guidance_scale": 6.04,
"lora_scale": 0.9,
"model": "dev",
"num_inference_steps": 32,
"num_outputs": 1,
"output_format": "png",
"output_quality": 90,
"prompt": "photo of JONSHUBJAM2 a bald man as a medieval knight.",
"prompt_strength": 0.8
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "bpcg0hf0rsrm40chza6r5sy20m",
"model": "jonathan-hubjam/jonathan-flux2",
"version": "9c9c3fc64279fe816ffbfd86d01b28ddcbe273e88fe5ee8e9d1cad5995d7be7a",
"input": {
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"guidance_scale": 6.04,
"lora_scale": 0.9,
"model": "dev",
"num_inference_steps": 32,
"num_outputs": 1,
"output_format": "png",
"output_quality": 90,
"prompt": "photo of JONSHUBJAM2 a bald man as a medieval knight.",
"prompt_strength": 0.8
},
"logs": "Using seed: 54910\nPrompt: photo of JONSHUBJAM2 a bald man as a medieval knight.\n[!] txt2img mode\nUsing dev model\nfree=6936407736320\nDownloading weights\n2024-09-16T11:18:17Z | INFO | [ Initiating ] chunk_size=150M dest=/tmp/tmpj_4wfj67/weights url=https://replicate.delivery/yhqm/Bl0KBnLareS2JClnT2Vrl8nH0cZeGWqUFvbX9fQhbQ1nC54mA/trained_model.tar\n2024-09-16T11:18:22Z | INFO | [ Complete ] dest=/tmp/tmpj_4wfj67/weights size=\"172 MB\" total_elapsed=4.210s url=https://replicate.delivery/yhqm/Bl0KBnLareS2JClnT2Vrl8nH0cZeGWqUFvbX9fQhbQ1nC54mA/trained_model.tar\nDownloaded weights in 4.25s\nLoaded LoRAs in 10.99s\n 0%| | 0/32 [00:00<?, ?it/s]\n 3%|▎ | 1/32 [00:00<00:09, 3.39it/s]\n 6%|▋ | 2/32 [00:00<00:07, 3.77it/s]\n 9%|▉ | 3/32 [00:00<00:08, 3.62it/s]\n 12%|█▎ | 4/32 [00:01<00:07, 3.56it/s]\n 16%|█▌ | 5/32 [00:01<00:07, 3.53it/s]\n 19%|█▉ | 6/32 [00:01<00:07, 3.51it/s]\n 22%|██▏ | 7/32 [00:01<00:07, 3.50it/s]\n 25%|██▌ | 8/32 [00:02<00:06, 3.49it/s]\n 28%|██▊ | 9/32 [00:02<00:06, 3.49it/s]\n 31%|███▏ | 10/32 [00:02<00:06, 3.48it/s]\n 34%|███▍ | 11/32 [00:03<00:06, 3.48it/s]\n 38%|███▊ | 12/32 [00:03<00:05, 3.48it/s]\n 41%|████ | 13/32 [00:03<00:05, 3.48it/s]\n 44%|████▍ | 14/32 [00:03<00:05, 3.48it/s]\n 47%|████▋ | 15/32 [00:04<00:04, 3.48it/s]\n 50%|█████ | 16/32 [00:04<00:04, 3.47it/s]\n 53%|█████▎ | 17/32 [00:04<00:04, 3.47it/s]\n 56%|█████▋ | 18/32 [00:05<00:04, 3.48it/s]\n 59%|█████▉ | 19/32 [00:05<00:03, 3.47it/s]\n 62%|██████▎ | 20/32 [00:05<00:03, 3.47it/s]\n 66%|██████▌ | 21/32 [00:06<00:03, 3.47it/s]\n 69%|██████▉ | 22/32 [00:06<00:02, 3.47it/s]\n 72%|███████▏ | 23/32 [00:06<00:02, 3.47it/s]\n 75%|███████▌ | 24/32 [00:06<00:02, 3.47it/s]\n 78%|███████▊ | 25/32 [00:07<00:02, 3.47it/s]\n 81%|████████▏ | 26/32 [00:07<00:01, 3.48it/s]\n 84%|████████▍ | 27/32 [00:07<00:01, 3.47it/s]\n 88%|████████▊ | 28/32 [00:08<00:01, 3.48it/s]\n 91%|█████████ | 29/32 [00:08<00:00, 3.47it/s]\n 94%|█████████▍| 30/32 [00:08<00:00, 3.48it/s]\n 97%|█████████▋| 31/32 [00:08<00:00, 3.48it/s]\n100%|██████████| 32/32 [00:09<00:00, 3.47it/s]\n100%|██████████| 32/32 [00:09<00:00, 3.49it/s]",
"output": [
"https://replicate.delivery/yhqm/gxTEzONCVtqBL9hxoMa9TzWNwieDdxpJ8w4RsE0asxBHMuuJA/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-09-16T11:18:07.814Z",
"started_at": "2024-09-16T11:18:17.782967Z",
"completed_at": "2024-09-16T11:18:38.500111Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/bpcg0hf0rsrm40chza6r5sy20m/cancel",
"get": "https://api.replicate.com/v1/predictions/bpcg0hf0rsrm40chza6r5sy20m",
"web": "https://replicate.com/p/bpcg0hf0rsrm40chza6r5sy20m"
},
"metrics": {
"predict_time": 20.717144038,
"total_time": 30.686111
}
}