@vibes.diy/prompts 14.3.46 → 14.3.47
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.initial.md +27 -0
- package/llms/image-gen.md +27 -0
- package/package.json +4 -4
|
@@ -94,6 +94,33 @@ Do **not** invent wrappers like `images={x?.file ? something : undefined}` — p
|
|
|
94
94
|
|
|
95
95
|
Do **not** set `model` for img2img: when an input image is present the platform automatically selects its image-**edit** default, which is tuned to produce edits faithful to the source. An explicit `model` override bypasses that routing — only use one when the app has a specific, stated reason.
|
|
96
96
|
|
|
97
|
+
## Restyling a Captured Photo
|
|
98
|
+
|
|
99
|
+
A photo booth, a style camera or an avatar-from-a-selfie app keeps the camera frame on the shot's own record and gives every styled result its own `_id` (bump it to start a fresh attempt). The styled picture's frame is simply `<ImgGen>`, shown at full size: ImgGen paints the saved result when there is one, and otherwise its own progress bar, its own message when a picture needs another try, and — in the Vibes iPhone app — the **Create with Image Playground** button that a picture started by the camera (rather than a tap) waits on. The person sees each of those right in the frame. Your own words about the shot sit beside or below the frame.
|
|
100
|
+
|
|
101
|
+
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.
|
|
102
|
+
|
|
103
|
+
```jsx
|
|
104
|
+
import { ImgGen, useImgGen } from "use-vibes";
|
|
105
|
+
|
|
106
|
+
function StyledShot({ shot, database }) {
|
|
107
|
+
const { document: styled } = useImgGen({ _id: shot.styledId, database });
|
|
108
|
+
const version = styled?.versions?.[styled.currentVersion ?? 0];
|
|
109
|
+
const ready = Boolean(version?.id && styled?._files?.[version.id]);
|
|
110
|
+
return (
|
|
111
|
+
<figure>
|
|
112
|
+
<div className="aspect-square w-full overflow-hidden rounded-md">
|
|
113
|
+
{shot._files?.original && (
|
|
114
|
+
<ImgGen _id={shot.styledId} database={database} prompt={shot.prompt}
|
|
115
|
+
images={[shot._files.original]} alt={`${shot.style} version`} className="h-full w-full object-contain" />
|
|
116
|
+
)}
|
|
117
|
+
</div>
|
|
118
|
+
<figcaption>{ready ? shot.style : `Styling as ${shot.style}. Your original is saved.`}</figcaption>
|
|
119
|
+
</figure>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
97
124
|
## Loading a Specific Doc
|
|
98
125
|
|
|
99
126
|
Load a previously generated image by `_id` — if the doc has a `prompt` but no `_files` yet, the component generates one: `<ImgGen _id="my-image-id" database={database} />`
|
package/llms/image-gen.md
CHANGED
|
@@ -94,6 +94,33 @@ Do **not** invent wrappers like `images={x?.file ? something : undefined}` — p
|
|
|
94
94
|
|
|
95
95
|
Do **not** set `model` for img2img: when an input image is present the platform automatically selects its image-**edit** default, which is tuned to produce edits faithful to the source. An explicit `model` override bypasses that routing — only use one when the app has a specific, stated reason.
|
|
96
96
|
|
|
97
|
+
## Restyling a Captured Photo
|
|
98
|
+
|
|
99
|
+
A photo booth, a style camera or an avatar-from-a-selfie app keeps the camera frame on the shot's own record and gives every styled result its own `_id` (bump it to start a fresh attempt). The styled picture's frame is simply `<ImgGen>`, shown at full size: ImgGen paints the saved result when there is one, and otherwise its own progress bar, its own message when a picture needs another try, and — in the Vibes iPhone app — the **Create with Image Playground** button that a picture started by the camera (rather than a tap) waits on. The person sees each of those right in the frame. Your own words about the shot sit beside or below the frame.
|
|
100
|
+
|
|
101
|
+
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.
|
|
102
|
+
|
|
103
|
+
```jsx
|
|
104
|
+
import { ImgGen, useImgGen } from "use-vibes";
|
|
105
|
+
|
|
106
|
+
function StyledShot({ shot, database }) {
|
|
107
|
+
const { document: styled } = useImgGen({ _id: shot.styledId, database });
|
|
108
|
+
const version = styled?.versions?.[styled.currentVersion ?? 0];
|
|
109
|
+
const ready = Boolean(version?.id && styled?._files?.[version.id]);
|
|
110
|
+
return (
|
|
111
|
+
<figure>
|
|
112
|
+
<div className="aspect-square w-full overflow-hidden rounded-md">
|
|
113
|
+
{shot._files?.original && (
|
|
114
|
+
<ImgGen _id={shot.styledId} database={database} prompt={shot.prompt}
|
|
115
|
+
images={[shot._files.original]} alt={`${shot.style} version`} className="h-full w-full object-contain" />
|
|
116
|
+
)}
|
|
117
|
+
</div>
|
|
118
|
+
<figcaption>{ready ? shot.style : `Styling as ${shot.style}. Your original is saved.`}</figcaption>
|
|
119
|
+
</figure>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
97
124
|
## Loading a Specific Doc
|
|
98
125
|
|
|
99
126
|
Load a previously generated image by `_id` — if the doc has a `prompt` but no `_files` yet, the component generates one: `<ImgGen _id="my-image-id" database={database} />`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/prompts",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.47",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"exports": {
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"license": "Apache-2.0",
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@adviser/cement": "~0.5.34",
|
|
40
|
-
"@vibes.diy/call-ai-v2": "14.3.
|
|
41
|
-
"@vibes.diy/identity": "14.3.
|
|
42
|
-
"@vibes.diy/use-vibes-types": "14.3.
|
|
40
|
+
"@vibes.diy/call-ai-v2": "14.3.47",
|
|
41
|
+
"@vibes.diy/identity": "14.3.47",
|
|
42
|
+
"@vibes.diy/use-vibes-types": "14.3.47",
|
|
43
43
|
"arktype": "~2.2.3",
|
|
44
44
|
"json-schema-faker": "~0.6.3"
|
|
45
45
|
},
|