defaulta portrait of young girl.
typetext
{
"guidance_scale": 3,
"negative_prompt": "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry.",
"positive_prompt": "masterpiece, film grained, best quality.",
"prompt": "a portrait of an astronaut riding a unicorn."
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Rgg**********************************
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 baaivision/emu3-gen using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"baaivision/emu3-gen:f65f4d8e2625bc9261768c129ec143c26c51f1aa11e12f2276a92fbfdf2359cd",
{
input: {
guidance_scale: 3,
negative_prompt: "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry.",
positive_prompt: "masterpiece, film grained, best quality.",
prompt: "a portrait of an astronaut riding a unicorn."
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
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_Rgg**********************************
This is your API token. Keep it to yourself.
import replicate
Run baaivision/emu3-gen using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"baaivision/emu3-gen:f65f4d8e2625bc9261768c129ec143c26c51f1aa11e12f2276a92fbfdf2359cd",
input={
"guidance_scale": 3,
"negative_prompt": "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry.",
"positive_prompt": "masterpiece, film grained, best quality.",
"prompt": "a portrait of an astronaut riding a unicorn."
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.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_Rgg**********************************
This is your API token. Keep it to yourself.
Run baaivision/emu3-gen 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": "baaivision/emu3-gen:f65f4d8e2625bc9261768c129ec143c26c51f1aa11e12f2276a92fbfdf2359cd",
"input": {
"guidance_scale": 3,
"negative_prompt": "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry.",
"positive_prompt": "masterpiece, film grained, best quality.",
"prompt": "a portrait of an astronaut riding a unicorn."
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "vxzmda2ng1rgj0cj92c8jb0bvr",
"model": "baaivision/emu3-gen",
"version": "f65f4d8e2625bc9261768c129ec143c26c51f1aa11e12f2276a92fbfdf2359cd",
"input": {
"guidance_scale": 3,
"negative_prompt": "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry.",
"positive_prompt": "masterpiece, film grained, best quality.",
"prompt": "a portrait of an astronaut riding a unicorn."
},
"logs": "The `seen_tokens` attribute is deprecated and will be removed in v4.41. Use the `cache_position` model input instead.\n3\n['<|extra_203|>a portrait of an astronaut riding a unicorn. masterpiece, film grained, best quality.', <PIL.Image.Image image mode=RGB size=720x720 at 0x7FD3B090F9D0>, '<|extra_204|>']",
"output": "https://replicate.delivery/pbxt/OfLafJBfpfpyvSXpDHVOH9pk4MJ8HSy1D48lRUWRwQzDuwJOB/out.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-10-01T14:59:55.904Z",
"started_at": "2024-10-01T15:01:18.747129Z",
"completed_at": "2024-10-01T15:10:26.138113Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/vxzmda2ng1rgj0cj92c8jb0bvr/cancel",
"get": "https://api.replicate.com/v1/predictions/vxzmda2ng1rgj0cj92c8jb0bvr",
"web": "https://replicate.com/p/vxzmda2ng1rgj0cj92c8jb0bvr"
},
"metrics": {
"predict_time": 547.390983833,
"total_time": 630.234113
}
}