studio-lumiere-cli 0.1.0
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/.agents/skills/annotate-image/SKILL.md +99 -0
- package/.agents/skills/config-troubleshooting/SKILL.md +97 -0
- package/.agents/skills/generate-images/SKILL.md +667 -0
- package/.agents/skills/generate-video/SKILL.md +328 -0
- package/.agents/skills/image-grid/SKILL.md +96 -0
- package/.agents/skills/image-overlay/SKILL.md +66 -0
- package/.agents/skills/image-overlay/agents/openai.yaml +4 -0
- package/.agents/skills/image-overlay/scripts/overlay-image.js +218 -0
- package/.agents/skills/muse-management/SKILL.md +232 -0
- package/.agents/skills/refine-images/SKILL.md +192 -0
- package/.agents/skills/tired-girl/SKILL.md +131 -0
- package/.env.example +2 -0
- package/AGENTS.md +66 -0
- package/README.md +96 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +214 -0
- package/dist/cli.js.map +1 -0
- package/dist/clients/geminiClient.d.ts +37 -0
- package/dist/clients/geminiClient.js +129 -0
- package/dist/clients/geminiClient.js.map +1 -0
- package/dist/config/constants.d.ts +63 -0
- package/dist/config/constants.js +1005 -0
- package/dist/config/constants.js.map +1 -0
- package/dist/config/options.d.ts +1 -0
- package/dist/config/options.js +2 -0
- package/dist/config/options.js.map +1 -0
- package/dist/config/templates.d.ts +3 -0
- package/dist/config/templates.js +4 -0
- package/dist/config/templates.js.map +1 -0
- package/dist/config/tiredGirl.d.ts +3 -0
- package/dist/config/tiredGirl.js +9 -0
- package/dist/config/tiredGirl.js.map +1 -0
- package/dist/image/annotate.d.ts +2 -0
- package/dist/image/annotate.js +119 -0
- package/dist/image/annotate.js.map +1 -0
- package/dist/image/grid.d.ts +2 -0
- package/dist/image/grid.js +44 -0
- package/dist/image/grid.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/pipelines/createMuse.d.ts +3 -0
- package/dist/pipelines/createMuse.js +49 -0
- package/dist/pipelines/createMuse.js.map +1 -0
- package/dist/pipelines/generateImages.d.ts +2 -0
- package/dist/pipelines/generateImages.js +140 -0
- package/dist/pipelines/generateImages.js.map +1 -0
- package/dist/pipelines/generateTiredGirl.d.ts +2 -0
- package/dist/pipelines/generateTiredGirl.js +73 -0
- package/dist/pipelines/generateTiredGirl.js.map +1 -0
- package/dist/pipelines/generateVideo.d.ts +2 -0
- package/dist/pipelines/generateVideo.js +27 -0
- package/dist/pipelines/generateVideo.js.map +1 -0
- package/dist/pipelines/refineImage.d.ts +2 -0
- package/dist/pipelines/refineImage.js +28 -0
- package/dist/pipelines/refineImage.js.map +1 -0
- package/dist/pipelines/resolve.d.ts +11 -0
- package/dist/pipelines/resolve.js +74 -0
- package/dist/pipelines/resolve.js.map +1 -0
- package/dist/pipelines/upscaleImage.d.ts +2 -0
- package/dist/pipelines/upscaleImage.js +23 -0
- package/dist/pipelines/upscaleImage.js.map +1 -0
- package/dist/prompt/buildPrompt.d.ts +4 -0
- package/dist/prompt/buildPrompt.js +322 -0
- package/dist/prompt/buildPrompt.js.map +1 -0
- package/dist/prompt/tiredGirlPrompt.d.ts +3 -0
- package/dist/prompt/tiredGirlPrompt.js +33 -0
- package/dist/prompt/tiredGirlPrompt.js.map +1 -0
- package/dist/storage/files.d.ts +15 -0
- package/dist/storage/files.js +34 -0
- package/dist/storage/files.js.map +1 -0
- package/dist/storage/museStore.d.ts +5 -0
- package/dist/storage/museStore.js +26 -0
- package/dist/storage/museStore.js.map +1 -0
- package/dist/types.d.ts +169 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/examples/generate.d.ts +1 -0
- package/examples/generate.js +28 -0
- package/examples/generate.js.map +1 -0
- package/examples/generate.ts +30 -0
- package/examples/muse.d.ts +1 -0
- package/examples/muse.js +18 -0
- package/examples/muse.js.map +1 -0
- package/examples/muse.ts +20 -0
- package/examples/video.d.ts +1 -0
- package/examples/video.js +18 -0
- package/examples/video.js.map +1 -0
- package/examples/video.ts +20 -0
- package/logo-round.png +0 -0
- package/logo.jpeg +0 -0
- package/package.json +27 -0
- package/src/cli.ts +259 -0
- package/src/clients/geminiClient.ts +168 -0
- package/src/config/constants.ts +1105 -0
- package/src/config/options.ts +15 -0
- package/src/config/templates.ts +4 -0
- package/src/config/tiredGirl.ts +11 -0
- package/src/image/annotate.ts +139 -0
- package/src/image/grid.ts +58 -0
- package/src/index.ts +27 -0
- package/src/pipelines/createMuse.ts +76 -0
- package/src/pipelines/generateImages.ts +203 -0
- package/src/pipelines/generateTiredGirl.ts +86 -0
- package/src/pipelines/generateVideo.ts +36 -0
- package/src/pipelines/refineImage.ts +36 -0
- package/src/pipelines/resolve.ts +88 -0
- package/src/pipelines/upscaleImage.ts +30 -0
- package/src/prompt/buildPrompt.ts +380 -0
- package/src/prompt/tiredGirlPrompt.ts +35 -0
- package/src/storage/files.ts +41 -0
- package/src/storage/museStore.ts +31 -0
- package/src/types.ts +198 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: muse-management
|
|
3
|
+
description: Create and manage Muses locally with the SDK/CLI; use when building or reusing Muse profiles.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: Muse Creation & Management (local-lumiere)
|
|
7
|
+
|
|
8
|
+
This document is a complete, end-to-end guide for creating and managing Muses locally using the **local-lumiere** SDK/CLI. It covers every function, parameter, and configuration point involved in Muse creation and reuse.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Quick Start (60 seconds)
|
|
13
|
+
|
|
14
|
+
1) Ensure `GEMINI_API_KEY` is set in your environment.
|
|
15
|
+
2) Build the project:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
npm install
|
|
19
|
+
npm run build
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
3) Create a Muse via CLI:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
node dist/cli.js muse \
|
|
26
|
+
--name "Editorial Muse" \
|
|
27
|
+
--source ./inputs/muse_source.jpg \
|
|
28
|
+
--variations 3
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
4) Find outputs under `outputs/muses/<timestamp>/` and the local index in `outputs/muses.json`.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 0) Purpose
|
|
36
|
+
|
|
37
|
+
Muses are reusable model references. You create a Muse by generating variation portraits from a source image, then selecting 3 to store as the Muse’s reference set. Those reference images can be used in `generateImages()` to keep model identity consistent.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 1) Where the Muse API Lives
|
|
42
|
+
|
|
43
|
+
**SDK entrypoint**: `src/index.ts`
|
|
44
|
+
|
|
45
|
+
- `createMuse`
|
|
46
|
+
- `generateMuseVariations`
|
|
47
|
+
|
|
48
|
+
**Pipeline implementation**: `src/pipelines/createMuse.ts`
|
|
49
|
+
|
|
50
|
+
**Muse storage**: `src/storage/museStore.ts`
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 2) Required Environment and Configuration
|
|
55
|
+
|
|
56
|
+
### 2.1 Environment Variables
|
|
57
|
+
|
|
58
|
+
- `GEMINI_API_KEY` (required)
|
|
59
|
+
- `LUMIERE_OUTPUT_DIR` (optional, default `outputs`)
|
|
60
|
+
|
|
61
|
+
### 2.2 Runtime Config Object
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
export interface LumiereConfig {
|
|
65
|
+
apiKey: string;
|
|
66
|
+
outputDir: string;
|
|
67
|
+
models?: {
|
|
68
|
+
prompt?: string;
|
|
69
|
+
image?: string;
|
|
70
|
+
video?: string;
|
|
71
|
+
};
|
|
72
|
+
retry?: {
|
|
73
|
+
maxRetries?: number;
|
|
74
|
+
baseDelayMs?: number;
|
|
75
|
+
maxDelayMs?: number;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 3) Primary Functions
|
|
83
|
+
|
|
84
|
+
### 3.1 generateMuseVariations
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
export const generateMuseVariations = async (
|
|
88
|
+
config: LumiereConfig,
|
|
89
|
+
sourceImage: string,
|
|
90
|
+
count: number,
|
|
91
|
+
outputDir: string
|
|
92
|
+
): Promise<string[]>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Behavior:**
|
|
96
|
+
- Creates `count` portrait variations from the source image.
|
|
97
|
+
- Enforces **same identity** but different hair, styling, pose, and background.
|
|
98
|
+
- Writes each variation as `variation_<n>.png`.
|
|
99
|
+
|
|
100
|
+
### 3.2 createMuse
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
export const createMuse = async (
|
|
104
|
+
config: LumiereConfig,
|
|
105
|
+
request: CreateMuseRequest
|
|
106
|
+
): Promise<CreateMuseResult>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
export interface CreateMuseRequest {
|
|
111
|
+
name: string; // Required
|
|
112
|
+
sourceImage: string; // Required
|
|
113
|
+
variations?: number; // Optional (default: 3)
|
|
114
|
+
outputDir?: string; // Optional override
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
export interface CreateMuseResult {
|
|
120
|
+
muse: MuseRecord;
|
|
121
|
+
variationPaths: string[];
|
|
122
|
+
logPath: string;
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 4) Muse Storage and Indexing
|
|
129
|
+
|
|
130
|
+
Muses are stored locally in a simple JSON index at:
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
<outputDir>/muses.json
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Each Muse record:
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
export interface MuseRecord {
|
|
140
|
+
id: string;
|
|
141
|
+
name: string;
|
|
142
|
+
imagePaths: string[]; // exactly 3 paths used for reference
|
|
143
|
+
createdAt: string;
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The helper functions in `src/storage/museStore.ts` allow:
|
|
148
|
+
|
|
149
|
+
- `loadMuses(baseDir)`
|
|
150
|
+
- `saveMuses(baseDir, muses)`
|
|
151
|
+
- `addMuse(baseDir, muse)`
|
|
152
|
+
- `getMuseById(baseDir, id)`
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## 5) Using a Muse in Image Generation
|
|
157
|
+
|
|
158
|
+
To use a Muse when generating images, provide **either**:
|
|
159
|
+
|
|
160
|
+
- `museImagePaths` (direct paths), OR
|
|
161
|
+
- `museId` (stored in `muses.json`)
|
|
162
|
+
|
|
163
|
+
Example in `generateImages()`:
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
await generateImages(config, {
|
|
167
|
+
inputImages: ["./inputs/ring.jpg"],
|
|
168
|
+
selections: { templateId: "half_body_muse" },
|
|
169
|
+
museId: "muse_1700000000000"
|
|
170
|
+
});
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## 6) CLI Usage
|
|
176
|
+
|
|
177
|
+
### 6.1 Create a Muse
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
node dist/cli.js muse --name "Editorial Muse" --source ./inputs/muse_source.jpg --variations 3
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
The CLI does not include a delete or rename command; those are handled by editing `muses.json` directly or using the helper functions in code.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## 7) SDK Example
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
import { createMuse } from "./dist/index.js";
|
|
191
|
+
|
|
192
|
+
const result = await createMuse(
|
|
193
|
+
{ apiKey, outputDir: "outputs" },
|
|
194
|
+
{ name: "Editorial Muse", sourceImage: "./inputs/muse_source.jpg", variations: 3 }
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
console.log(result.muse.id);
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## 8) Error Handling and Retries
|
|
203
|
+
|
|
204
|
+
Muse creation uses the same retry settings as other pipelines.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## 9) Related Files
|
|
209
|
+
|
|
210
|
+
- `src/pipelines/createMuse.ts`
|
|
211
|
+
- `src/storage/museStore.ts`
|
|
212
|
+
- `src/clients/geminiClient.ts`
|
|
213
|
+
- `src/cli.ts`
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## 10) See Also
|
|
218
|
+
|
|
219
|
+
- `C:\Users\karim\Documents\local-lumiere\.agents\skills\config-troubleshooting.md`
|
|
220
|
+
|
|
221
|
+
End of skill.
|
|
222
|
+
|
|
223
|
+
## Related Skills
|
|
224
|
+
|
|
225
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\generate-images.md`
|
|
226
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\generate-video.md`
|
|
227
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\refine-images.md`
|
|
228
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\muse-management.md`
|
|
229
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\tired-girl.md`
|
|
230
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\image-grid.md`
|
|
231
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\config-troubleshooting.md`
|
|
232
|
+
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: refine-images
|
|
3
|
+
description: Refine existing images with the local-lumiere SDK/CLI; use when you need to enhance or edit prior outputs.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: Refine Images (local-lumiere)
|
|
7
|
+
|
|
8
|
+
This document is a complete, end-to-end guide for an AI agent to refine existing images using the **local-lumiere** SDK/CLI. It covers every function, parameter, and configuration point involved in refinement.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Quick Start (60 seconds)
|
|
13
|
+
|
|
14
|
+
1) Ensure `GEMINI_API_KEY` is set in your environment.
|
|
15
|
+
2) Build the project:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
npm install
|
|
19
|
+
npm run build
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
3) Refine an image via CLI:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
node dist/cli.js refine \
|
|
26
|
+
--image ./outputs/generations/<timestamp>/image_1.png \
|
|
27
|
+
--instruction "Make the ring slightly larger"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
4) Find output files under `outputs/refinements/<timestamp>/`.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 0) Purpose
|
|
35
|
+
|
|
36
|
+
Refinement applies targeted edits to an existing image while preserving jewelry fidelity, lighting, and composition unless explicitly changed. This is ideal for adjusting size, mood, or minor details without re-generating from scratch.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 1) Where the Refinement API Lives
|
|
41
|
+
|
|
42
|
+
**SDK entrypoint**: `src/index.ts`
|
|
43
|
+
|
|
44
|
+
- `refineImage` (primary API)
|
|
45
|
+
|
|
46
|
+
**Pipeline implementation**: `src/pipelines/refineImage.ts`
|
|
47
|
+
|
|
48
|
+
**Gemini client wrapper**: `src/clients/geminiClient.ts`
|
|
49
|
+
|
|
50
|
+
**File I/O**: `src/storage/files.ts`
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 2) Required Environment and Configuration
|
|
55
|
+
|
|
56
|
+
### 2.1 Environment Variables
|
|
57
|
+
|
|
58
|
+
- `GEMINI_API_KEY` (required)
|
|
59
|
+
- `LUMIERE_OUTPUT_DIR` (optional, default `outputs`)
|
|
60
|
+
|
|
61
|
+
### 2.2 Runtime Config Object
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
export interface LumiereConfig {
|
|
65
|
+
apiKey: string;
|
|
66
|
+
outputDir: string;
|
|
67
|
+
models?: {
|
|
68
|
+
prompt?: string;
|
|
69
|
+
image?: string;
|
|
70
|
+
video?: string;
|
|
71
|
+
};
|
|
72
|
+
retry?: {
|
|
73
|
+
maxRetries?: number;
|
|
74
|
+
baseDelayMs?: number;
|
|
75
|
+
maxDelayMs?: number;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 3) Primary Function: refineImage
|
|
83
|
+
|
|
84
|
+
### 3.1 Function Signature
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
export const refineImage = async (
|
|
88
|
+
config: LumiereConfig,
|
|
89
|
+
request: RefineRequest
|
|
90
|
+
): Promise<string>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 3.2 Request Object: RefineRequest
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
export interface RefineRequest {
|
|
97
|
+
inputImage: string; // Required. Path to local image file.
|
|
98
|
+
instruction: string; // Required. Natural-language refinement instruction.
|
|
99
|
+
sizeAdjustment?: number; // Optional. Percentage size of jewelry (e.g. 80, 120).
|
|
100
|
+
outputDir?: string; // Optional. Override config.outputDir.
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 3.3 Behavior
|
|
105
|
+
|
|
106
|
+
- Builds a refinement prompt using the instruction.
|
|
107
|
+
- If `sizeAdjustment` is provided and not 100, it explicitly scales **all jewelry** by that percent.
|
|
108
|
+
- Uses the Gemini image model via `GeminiClient.generateImage()`.
|
|
109
|
+
- Saves output as `refined.png` in `outputs/refinements/<timestamp>/`.
|
|
110
|
+
- Writes `refine.json` log with input path, instruction, size, output path.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 4) CLI Usage
|
|
115
|
+
|
|
116
|
+
### 4.1 Basic Refinement
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
node dist/cli.js refine \
|
|
120
|
+
--image ./outputs/generations/<timestamp>/image_1.png \
|
|
121
|
+
--instruction "Soften the lighting and add a warmer mood"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### 4.2 Size Adjustment
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
node dist/cli.js refine \
|
|
128
|
+
--image ./outputs/generations/<timestamp>/image_1.png \
|
|
129
|
+
--instruction "Keep everything else the same" \
|
|
130
|
+
--size 120
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## 5) SDK Example
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
import { refineImage } from "./dist/index.js";
|
|
139
|
+
|
|
140
|
+
const outputPath = await refineImage(
|
|
141
|
+
{ apiKey, outputDir: "outputs" },
|
|
142
|
+
{
|
|
143
|
+
inputImage: "./outputs/generations/.../image_1.png",
|
|
144
|
+
instruction: "Make the ring slightly larger and the background softer",
|
|
145
|
+
sizeAdjustment: 115
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
console.log(outputPath);
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## 6) Error Handling and Retries
|
|
155
|
+
|
|
156
|
+
Refinement uses the same retry settings as other pipelines:
|
|
157
|
+
|
|
158
|
+
```ts
|
|
159
|
+
retry: {
|
|
160
|
+
maxRetries: 3,
|
|
161
|
+
baseDelayMs: 1500,
|
|
162
|
+
maxDelayMs: 12000
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## 7) Related Files
|
|
169
|
+
|
|
170
|
+
- `src/pipelines/refineImage.ts`
|
|
171
|
+
- `src/clients/geminiClient.ts`
|
|
172
|
+
- `src/storage/files.ts`
|
|
173
|
+
- `src/cli.ts`
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 8) See Also
|
|
178
|
+
|
|
179
|
+
- `C:\Users\karim\Documents\local-lumiere\.agents\skills\config-troubleshooting.md`
|
|
180
|
+
|
|
181
|
+
End of skill.
|
|
182
|
+
|
|
183
|
+
## Related Skills
|
|
184
|
+
|
|
185
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\generate-images.md`
|
|
186
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\generate-video.md`
|
|
187
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\refine-images.md`
|
|
188
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\muse-management.md`
|
|
189
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\tired-girl.md`
|
|
190
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\image-grid.md`
|
|
191
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\config-troubleshooting.md`
|
|
192
|
+
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tired-girl
|
|
3
|
+
description: Generate the tired-girl before-look image with no jewelry using a Muse or reference image; use for before/after sets.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: Tired Girl (Before-Look) Generation (local-lumiere)
|
|
7
|
+
|
|
8
|
+
This document explains how to generate a "before" look image (tired, morning, no-makeup, crazy hair, pyjama) with **NO jewelry**, using either a Muse (preferred) or a single reference image.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Quick Start (60 seconds)
|
|
13
|
+
|
|
14
|
+
1) Ensure `GEMINI_API_KEY` is set.
|
|
15
|
+
2) Build the project:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
npm install
|
|
19
|
+
npm run build
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
3) Generate a tired-girl image via CLI:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
node dist/cli.js tired-girl \
|
|
26
|
+
--muse-id muse_1700000000000 \
|
|
27
|
+
--styles tired,morning \
|
|
28
|
+
--quantity 2
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
4) Find outputs under `outputs/tired_girl/<timestamp>/`.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 1) API Location
|
|
36
|
+
|
|
37
|
+
- Pipeline: `src/pipelines/generateTiredGirl.ts`
|
|
38
|
+
- Prompt builder: `src/prompt/tiredGirlPrompt.ts`
|
|
39
|
+
- Styles config: `src/config/tiredGirl.ts`
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 2) Request/Response
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
export interface TiredGirlRequest {
|
|
47
|
+
inputImage?: string;
|
|
48
|
+
museId?: string;
|
|
49
|
+
styleIds?: string[];
|
|
50
|
+
quantity?: number;
|
|
51
|
+
outputDir?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface TiredGirlResult {
|
|
55
|
+
outputImages: string[];
|
|
56
|
+
logPath: string;
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Rules:
|
|
61
|
+
- If `museId` is provided, it is used and `inputImage` is ignored.
|
|
62
|
+
- If `museId` is not provided, `inputImage` is required.
|
|
63
|
+
- `quantity` defaults to 1.
|
|
64
|
+
- Styles cycle if quantity exceeds provided styles.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 3) Styles
|
|
69
|
+
|
|
70
|
+
Defined in `src/config/tiredGirl.ts`:
|
|
71
|
+
|
|
72
|
+
- `tired`
|
|
73
|
+
- `morning`
|
|
74
|
+
- `no_makeup`
|
|
75
|
+
- `crazy_hair`
|
|
76
|
+
- `pyjama`
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 4) Two-Step Approach
|
|
81
|
+
|
|
82
|
+
1) **Prompt enhancement** with reference images + user prompt (no jewelry requirement).
|
|
83
|
+
2) **Image generation** using the enhanced prompt + reference images.
|
|
84
|
+
|
|
85
|
+
Both steps are image-conditioned, mirroring the app’s two-step approach.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 5) CLI Usage
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
node dist/cli.js tired-girl --muse-id muse_123 --styles tired,pyjama --quantity 2
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Or with a single reference image:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
node dist/cli.js tired-girl --image ./inputs/model.jpg --styles no_makeup
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 6) SDK Example
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
import { generateTiredGirl } from "./dist/index.js";
|
|
107
|
+
|
|
108
|
+
const result = await generateTiredGirl(
|
|
109
|
+
{ apiKey, outputDir: "outputs" },
|
|
110
|
+
{
|
|
111
|
+
museId: "muse_1700000000000",
|
|
112
|
+
styleIds: ["tired", "pyjama"],
|
|
113
|
+
quantity: 2
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
console.log(result.outputImages);
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Related Skills
|
|
123
|
+
|
|
124
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\generate-images.md`
|
|
125
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\generate-video.md`
|
|
126
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\refine-images.md`
|
|
127
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\muse-management.md`
|
|
128
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\tired-girl.md`
|
|
129
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\image-grid.md`
|
|
130
|
+
- `C:\\Users\\karim\\Documents\\local-lumiere\\.agents\\skills\\config-troubleshooting.md`
|
|
131
|
+
|
package/.env.example
ADDED
package/AGENTS.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# AI Agent Workflow & Standards
|
|
2
|
+
|
|
3
|
+
This document outlines the mandatory workflow for all AI agents collaborating on this project. Strictly adhere to these procedures for every brand-new feature or significant task.
|
|
4
|
+
|
|
5
|
+
## Image Overlay Defaults
|
|
6
|
+
|
|
7
|
+
- Logo file: `logo-round.png`
|
|
8
|
+
- Placement: `top-left`
|
|
9
|
+
- Scale: `0.08`
|
|
10
|
+
- Margin: `24`
|
|
11
|
+
- Opacity: `0.75`
|
|
12
|
+
- Script: `node .agents/skills/image-overlay/scripts/overlay-image.js`
|
|
13
|
+
|
|
14
|
+
## 1. Workspace Preparation
|
|
15
|
+
|
|
16
|
+
* **Stories Directory:** All documentation and state tracking for a task must reside in the `stories/` folder.
|
|
17
|
+
* *Action:* Check if the `stories/` folder exists. If not, create it immediately.
|
|
18
|
+
* **Git Branching:** All work must be performed on a dedicated feature branch.
|
|
19
|
+
* *Naming Convention:* `story/<name-of-story>` (e.g., `story/mobile-ui-fix`).
|
|
20
|
+
* *Action:* Create and switch to the new branch before writing any code.
|
|
21
|
+
* *IMPORTANT:* all git commands should be executed one at a time. Don't try to chain them in one command.
|
|
22
|
+
|
|
23
|
+
## 2. The 5-Step Development Process
|
|
24
|
+
|
|
25
|
+
We follow a strict iterative cycle. All outputs from these steps must be documented in a **single file** within the `stories/` folder.
|
|
26
|
+
|
|
27
|
+
**Documentation File Details:**
|
|
28
|
+
* **Location:** `stories/`
|
|
29
|
+
* **Naming Convention:** `YYYY-MM-DD-short-descriptive-name.md` (e.g., `2026-01-25-mobile-ui-refactor.md`).
|
|
30
|
+
* **Format:** Markdown.
|
|
31
|
+
|
|
32
|
+
### Step 1: Spec
|
|
33
|
+
* Analyze the user's request and requirements.
|
|
34
|
+
* Define the scope, goals, and technical constraints.
|
|
35
|
+
* Write this into the documentation file under a `## Spec` header.
|
|
36
|
+
|
|
37
|
+
### Step 2: Plan
|
|
38
|
+
* Break down the implementation into actionable steps.
|
|
39
|
+
* Identify necessary file changes, dependencies, and architectural impacts.
|
|
40
|
+
* Write this into the documentation file under a `## Plan` header.
|
|
41
|
+
|
|
42
|
+
### Step 3: Implement
|
|
43
|
+
* Write the code according to the approved plan.
|
|
44
|
+
* Adhere to existing project patterns, style guides, and tech stack conventions.
|
|
45
|
+
* Log significant actions or decisions in the documentation file under a `## Implementation Log` header.
|
|
46
|
+
|
|
47
|
+
### Step 4: Review
|
|
48
|
+
* Self-critique the code.
|
|
49
|
+
* Run builds, linters, and tests (`npm run build`, `npx tsc --noEmit`, etc.) to verify correctness.
|
|
50
|
+
* Present the results and any findings to the user.
|
|
51
|
+
* Write findings in the documentation file under a `## Review` header.
|
|
52
|
+
|
|
53
|
+
### Step 5: Fix (Iterative Loop)
|
|
54
|
+
* Address issues found in the Review step or feedback provided by the user.
|
|
55
|
+
* **Loop:** Repeat Steps 4 (Review) and 5 (Fix) until the user explicitly confirms the code works and is approved.
|
|
56
|
+
* Log fixes and subsequent reviews in the documentation file.
|
|
57
|
+
|
|
58
|
+
## 3. Completion & Git Workflow
|
|
59
|
+
|
|
60
|
+
Once the work is approved by the user (after the Review/Fix loop):
|
|
61
|
+
|
|
62
|
+
1. **Stage Files:** `git add` all relevant code files and the story documentation file.
|
|
63
|
+
2. **Review Changes:** Use the command `/git:review` to generate a summary of staged changes.
|
|
64
|
+
3. **Commit:** Use the command `/git:commit` to create the commit.
|
|
65
|
+
4. **Push & PR:** Use the command `/git:commit-push-pr` to push the branch and automatically create/open a Pull Request.
|
|
66
|
+
5. **Cleanup:** Use the command `/git:clean-gone` to clean up local branches and synchronize with the remote.
|
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# local-lumiere
|
|
2
|
+
|
|
3
|
+
Local SDK + CLI for Studio Lumiere generation flows. Runs entirely on your machine and talks directly to Gemini APIs.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
1) Install dependencies
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
2) Create `.env`
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
GEMINI_API_KEY=your_key_here
|
|
17
|
+
LUMIERE_OUTPUT_DIR=outputs
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## CLI Usage
|
|
21
|
+
|
|
22
|
+
List options:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
node dist/cli.js list templates
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Generate images:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
node dist/cli.js generate \
|
|
32
|
+
--images ./inputs/ring.jpg \
|
|
33
|
+
--template hand_model \
|
|
34
|
+
--detail nail_nude \
|
|
35
|
+
--ethnicity mena \
|
|
36
|
+
--skin-tone medium \
|
|
37
|
+
--hair-color brunette \
|
|
38
|
+
--background cream_silk \
|
|
39
|
+
--background-type studio \
|
|
40
|
+
--vibe clean \
|
|
41
|
+
--resolution portrait \
|
|
42
|
+
--quantity 2
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Refine:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
node dist/cli.js refine --image ./outputs/image.png --instruction "Make the ring slightly larger"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Upscale:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
node dist/cli.js upscale --image ./outputs/image.png --scale 2
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Create a Muse:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
node dist/cli.js muse --name "Editorial Muse" --source ./inputs/muse_source.jpg --variations 3
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Generate video:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
node dist/cli.js video --prompt "Cinematic head turn showing earrings" --aspect 9:16 --duration 5
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## SDK Usage
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
import { generateImages } from "local-lumiere";
|
|
73
|
+
|
|
74
|
+
const result = await generateImages({ apiKey, outputDir: "outputs" }, {
|
|
75
|
+
inputImages: ["./inputs/ring.jpg"],
|
|
76
|
+
quantity: 1,
|
|
77
|
+
selections: {
|
|
78
|
+
templateId: "hand_model",
|
|
79
|
+
detailId: "nail_nude",
|
|
80
|
+
ethnicityId: "mena",
|
|
81
|
+
skinToneId: "medium",
|
|
82
|
+
hairColorId: "brunette",
|
|
83
|
+
backgroundId: "cream_silk",
|
|
84
|
+
backgroundTypeId: "studio",
|
|
85
|
+
vibeId: "clean",
|
|
86
|
+
resolutionId: "portrait"
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Notes
|
|
92
|
+
|
|
93
|
+
- The config lists are a curated subset of the full Studio Lumiere options. You can add or override options in `src/config/`.
|
|
94
|
+
- The Muse flow generates variations and stores a local `muses.json` index under your output directory.
|
|
95
|
+
- Video generation uses Veo via the Gemini SDK and returns an operation name plus the video file when available.
|
|
96
|
+
|