https://github.com/faker-js/assets-person-portrait
The repository containing the assets for the person portraits
https://github.com/faker-js/assets-person-portrait
faker image person portrait
Last synced: 4 months ago
JSON representation
The repository containing the assets for the person portraits
- Host: GitHub
- URL: https://github.com/faker-js/assets-person-portrait
- Owner: faker-js
- License: cc0-1.0
- Created: 2024-10-26T16:56:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-12T08:26:24.000Z (over 1 year ago)
- Last Synced: 2025-06-28T10:40:04.784Z (12 months ago)
- Topics: faker, image, person, portrait
- Language: HTML
- Homepage: https://faker-js.github.io/assets-person-portrait/
- Size: 51.1 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Faker Assets for Person Portraits
This repository is only for hosting images for [`faker.image.personPortrait()`](https://fakerjs.dev/api/image.html#personportrait).
Requires `@faker-js/faker` v9.5.0 or later
> [!IMPORTANT]
> The [images](https://faker-js.github.io/assets-person-portrait/) 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](https://github.com/faker-js/faker). \
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
## Repo Structure
```txt
/SEX/SIZE/INDEX.jpg
/{male,female}/{32,64,128,256,512}/{0...99}.jpg
```
## Re-Generating New Images
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](https://replicate.com/pricing) to generate.
```js
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);
```