typetext
{
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": false,
"guidance_scale": 3,
"lora_scale": 1,
"megapixels": "1",
"model": "dev",
"num_inference_steps": 28,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A family at the beach. Red JAMBOX in the middle of the beach towel.",
"prompt_strength": 0.8
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_ZF7**********************************
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 chakify/flux-dev-lora-jambox using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"chakify/flux-dev-lora-jambox:9dfdeb3a61e1f7f2e056da4fbc9d3ebe7af637c17c0f06acfbfdcd3dec5be9e9",
{
input: {
aspect_ratio: "1:1",
extra_lora_scale: 1,
go_fast: false,
guidance_scale: 3,
lora_scale: 1,
megapixels: "1",
model: "dev",
num_inference_steps: 28,
num_outputs: 1,
output_format: "webp",
output_quality: 80,
prompt: "A family at the beach. Red JAMBOX in the middle of the beach towel.",
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_ZF7**********************************
This is your API token. Keep it to yourself.
import replicate
Run chakify/flux-dev-lora-jambox using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"chakify/flux-dev-lora-jambox:9dfdeb3a61e1f7f2e056da4fbc9d3ebe7af637c17c0f06acfbfdcd3dec5be9e9",
input={
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": False,
"guidance_scale": 3,
"lora_scale": 1,
"megapixels": "1",
"model": "dev",
"num_inference_steps": 28,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A family at the beach. Red JAMBOX in the middle of the beach towel.",
"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_ZF7**********************************
This is your API token. Keep it to yourself.
Run chakify/flux-dev-lora-jambox 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": "chakify/flux-dev-lora-jambox:9dfdeb3a61e1f7f2e056da4fbc9d3ebe7af637c17c0f06acfbfdcd3dec5be9e9",
"input": {
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": false,
"guidance_scale": 3,
"lora_scale": 1,
"megapixels": "1",
"model": "dev",
"num_inference_steps": 28,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A family at the beach. Red JAMBOX in the middle of the beach towel.",
"prompt_strength": 0.8
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "c3m00t7myxrmc0ckw01tn99mh4",
"model": "chakify/flux-dev-lora-jambox",
"version": "9dfdeb3a61e1f7f2e056da4fbc9d3ebe7af637c17c0f06acfbfdcd3dec5be9e9",
"input": {
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": false,
"guidance_scale": 3,
"lora_scale": 1,
"megapixels": "1",
"model": "dev",
"num_inference_steps": 28,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A family at the beach. Red JAMBOX in the middle of the beach towel.",
"prompt_strength": 0.8
},
"logs": "Lora https://replicate.delivery/xezq/d5bqeLHzgyTgB6ZNTgeRiQz2354rWndrtnnSaf9XszVNDB5nA/trained_model.tar already loaded\nUsing seed: 57833\n0it [00:00, ?it/s]\n1it [00:00, 8.37it/s]\n2it [00:00, 5.84it/s]\n3it [00:00, 5.33it/s]\n4it [00:00, 5.11it/s]\n5it [00:00, 4.98it/s]\n6it [00:01, 4.89it/s]\n7it [00:01, 4.86it/s]\n8it [00:01, 4.84it/s]\n9it [00:01, 4.83it/s]\n10it [00:01, 4.82it/s]\n11it [00:02, 4.79it/s]\n12it [00:02, 4.79it/s]\n13it [00:02, 4.80it/s]\n14it [00:02, 4.80it/s]\n15it [00:03, 4.78it/s]\n16it [00:03, 4.78it/s]\n17it [00:03, 4.79it/s]\n18it [00:03, 4.80it/s]\n19it [00:03, 4.80it/s]\n20it [00:04, 4.79it/s]\n21it [00:04, 4.78it/s]\n22it [00:04, 4.78it/s]\n23it [00:04, 4.78it/s]\n24it [00:04, 4.79it/s]\n25it [00:05, 4.79it/s]\n26it [00:05, 4.79it/s]\n27it [00:05, 4.78it/s]\n28it [00:05, 4.78it/s]\n28it [00:05, 4.86it/s]\nTotal safe images: 1 out of 1",
"output": [
"https://replicate.delivery/xezq/b4I7O8bL7MKKFtZzRfLozt2kZuXYoDlqh5P1RNuvloSTaQeTA/out-0.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-12-19T17:42:55.991Z",
"started_at": "2024-12-19T17:42:55.999441Z",
"completed_at": "2024-12-19T17:43:02.078764Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/c3m00t7myxrmc0ckw01tn99mh4/cancel",
"get": "https://api.replicate.com/v1/predictions/c3m00t7myxrmc0ckw01tn99mh4",
"stream": "https://stream.replicate.com/v1/files/bcwr-e27ui4cyc5e677yvfp6nxlau25u6dlrf7yqh73oqrxummtqjlqzq",
"web": "https://replicate.com/p/c3m00t7myxrmc0ckw01tn99mh4"
},
"metrics": {
"predict_time": 6.079322364,
"total_time": 6.087764
}
}