@vibes.diy/prompts 14.3.142 → 14.3.144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/llms/image-gen.md +12 -3
- package/package.json +5 -5
package/llms/image-gen.md
CHANGED
|
@@ -101,6 +101,8 @@ A photo booth, a style camera or an avatar-from-a-selfie app saves the camera fr
|
|
|
101
101
|
|
|
102
102
|
Mount that same `<ImgGen>` wherever an unstyled shot is shown in full — the fresh-capture card and the detail view — so a shot saved in one visit styles the next time it opens. Gallery tiles read the saved result through `useImgGen` and show the original until it arrives.
|
|
103
103
|
|
|
104
|
+
Show the person's own photo beside every styled result, so they can see their picture went in. A small thumbnail of the source next to (or tucked into a corner of) the result turns "is this even my photo?" into a before-and-after they enjoy. A stored ref displays with its `url`: `<img src={shot._files.original.url} />`.
|
|
105
|
+
|
|
104
106
|
```jsx
|
|
105
107
|
import { ImgGen, useImgGen } from "use-vibes";
|
|
106
108
|
|
|
@@ -108,12 +110,17 @@ function StyledShot({ shot, database }) {
|
|
|
108
110
|
const { document: styled } = useImgGen({ _id: shot._id, database });
|
|
109
111
|
const version = styled?.versions?.[styled.currentVersion ?? 0];
|
|
110
112
|
const ready = Boolean(version?.id && styled?._files?.[version.id]);
|
|
113
|
+
const original = shot._files?.original;
|
|
111
114
|
return (
|
|
112
115
|
<figure>
|
|
113
|
-
<div className="aspect-square w-full overflow-hidden rounded-md">
|
|
114
|
-
{
|
|
116
|
+
<div className="relative aspect-square w-full overflow-hidden rounded-md">
|
|
117
|
+
{original && (
|
|
115
118
|
<ImgGen _id={shot._id} database={database} prompt={shot.prompt}
|
|
116
|
-
images={[
|
|
119
|
+
images={[original]} alt={`${shot.style} version`} className="h-full w-full object-contain" />
|
|
120
|
+
)}
|
|
121
|
+
{original?.url && (
|
|
122
|
+
<img src={original.url} alt="Your original photo"
|
|
123
|
+
className="absolute bottom-2 left-2 h-16 w-16 rounded border-2 border-border object-cover shadow" />
|
|
117
124
|
)}
|
|
118
125
|
</div>
|
|
119
126
|
<figcaption>{ready ? shot.style : `Styling as ${shot.style}. Your original is saved.`}</figcaption>
|
|
@@ -122,6 +129,8 @@ function StyledShot({ shot, database }) {
|
|
|
122
129
|
}
|
|
123
130
|
```
|
|
124
131
|
|
|
132
|
+
When one photo becomes several looks at once (four costumes, a style sampler), upload it once: save the photo on its own record, then save one look record per style holding that photo record's `_id`, and pass the photo record's `_files.original` to every look's `<ImgGen>`. Every look then shares one upload and one source thumbnail, and each look still keeps its own `_id` for its result.
|
|
133
|
+
|
|
125
134
|
## Loading a Specific Doc
|
|
126
135
|
|
|
127
136
|
Load a previously generated image with its saved host record's `_id`: `<ImgGen _id={doc._id} database={database} />`. A literal such as `_id="my-image-id"` refers to a host record already saved under that exact `_id` in this database. If the host has a `prompt` but no stored image yet, the component generates one.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/prompts",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.144",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"exports": {
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"license": "Apache-2.0",
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@adviser/cement": "~0.5.34",
|
|
42
|
-
"@vibes.diy/api-types": "14.3.
|
|
43
|
-
"@vibes.diy/call-ai-v2": "14.3.
|
|
44
|
-
"@vibes.diy/identity": "14.3.
|
|
45
|
-
"@vibes.diy/use-vibes-types": "14.3.
|
|
42
|
+
"@vibes.diy/api-types": "14.3.144",
|
|
43
|
+
"@vibes.diy/call-ai-v2": "14.3.144",
|
|
44
|
+
"@vibes.diy/identity": "14.3.144",
|
|
45
|
+
"@vibes.diy/use-vibes-types": "14.3.144",
|
|
46
46
|
"arktype": "~2.2.6",
|
|
47
47
|
"json-schema-faker": "~0.6.3"
|
|
48
48
|
},
|