This repository is only for hosting images for faker.image.personPortrait()
.
Requires @faker-js/faker
v9.5.0 or later
Important
The images in this repository are generated by AI.
If you think that one of the pictures resembles you too closely and you would like us to change it, please let us know.
Please report any issues and feature requests to the main faker repo.
This repostory does not accept PRs to ensure we do not exceed GitHub's file, size and transfer limits.
Please access the assets via CDN:
https://cdn.jsdelivr.net/gh/faker-js/assets-person-portrait/female/512/42.jpg
/SEX/SIZE/INDEX.jpg
/{male,female}/{32,64,128,256,512}/{0...99}.jpg
The basic prompt used for Stable Diffusion 3 was:
profile picture of a ${age}-year-old ${sex} from ${country}
You can use the data in the male/metadata and female/metadata to regenerate images. You can run a model locally, or use a service like Replicate using https://github.com/replicate/replicate-javascript. You will need a Replicate API key, and expect it will cost approximately $0.035 per image to generate.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
const metadata = JSON.parse(fs.readFileSync("female/metadata/42.json"));
const input = metadata.parameters;
const output = await replicate.run(metadata.model, {
input,
});
console.log(output);