-
-
Notifications
You must be signed in to change notification settings - Fork 929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(image): add AI-generated avatars #3126
base: next
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for fakerjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #3126 +/- ##
========================================
Coverage 99.95% 99.96%
========================================
Files 2804 2804
Lines 216974 216985 +11
Branches 579 964 +385
========================================
+ Hits 216886 216916 +30
+ Misses 88 69 -19
|
As you wrote in the comment. We would like to host these images inside the faker org so we dont loose access to them again. The idea is to use a separate asset repository (to avoid bloating the main repo) and to put the images there but we didnt have enough time yet to plan the exact structure. |
* | ||
* @since 9.1.0 | ||
*/ | ||
avatarAI(options?: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method name doesnt really tell what this method returns, only how the result was generated.
As discussed elsewhere I would like to call these portraits, but I'm open to other suggestions.
*/ | ||
sex?: SexType; | ||
}): string { | ||
const type = options?.sex ?? this.faker.person.sexType(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use our normal destructuring syntax for this.
When we later store the images in the faker org, we should also place a file for each image with meta data, including: "used model, prompt, negative prompt, seed, parameters, ..." |
Lets put the technical discussion of what to put where and how in a separate issue. |
Yep. I'd suggest say faker-media as repo name (in case we want video or audio later), then (versioned?) subfolders for different methods (we might want e.g. dummy company logos in the future). The most important thing is that urls are stable as once the urls are generated they might be stored in a database so we want them accessible "forever". |
* faker.image.avatarAI({ sex: 'male' }) | ||
* // 'https://cdn.jsdelivr.net/.../male/32.jpg' | ||
* | ||
* @since 9.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @since 9.1.0 | |
* @since 9.2.0 |
Draft PR to explore the best API for this. CDN URL will need to be replaced with final one.
Uses 50 male and 50 female images generated as part of discussion here #465 (comment)
fix #465
fix #2173