prompts-data-productstage 1.0.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/README.md +293 -0
- package/dist/data/categories.d.ts +2 -0
- package/dist/data/categories.js +167 -0
- package/dist/data/prompts.d.ts +2 -0
- package/dist/data/prompts.js +754 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.js +140 -0
- package/dist/types.d.ts +36 -0
- package/dist/types.js +2 -0
- package/package.json +45 -0
package/README.md
ADDED
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
# @productstage/prompts-data
|
|
2
|
+
|
|
3
|
+
Professional AI product photography prompts library for e-commerce and online stores. This package contains curated prompt templates designed for various product categories, optimized for AI image generation platforms like Midjourney, Stable Diffusion, and DALL-E.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **29 Product Categories**: From jewelry and watches to furniture and handmade items
|
|
8
|
+
- **100+ Prompt Templates**: Carefully crafted professional photography prompts
|
|
9
|
+
- **Flexible Querying**: Filter by category, variant, keywords, and more
|
|
10
|
+
- **TypeScript Support**: Full type definitions included
|
|
11
|
+
- **Easy Integration**: Simple API for quick implementation
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @productstage/prompts-data
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
### Basic Usage
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import {
|
|
25
|
+
getAllCategories,
|
|
26
|
+
getPromptsWithCategories,
|
|
27
|
+
formatPrompt
|
|
28
|
+
} from '@productstage/prompts-data';
|
|
29
|
+
|
|
30
|
+
// Get all categories
|
|
31
|
+
const categories = getAllCategories();
|
|
32
|
+
console.log(`Available categories: ${categories.length}`);
|
|
33
|
+
|
|
34
|
+
// Get prompts with category information
|
|
35
|
+
const prompts = getPromptsWithCategories({ activeOnly: true });
|
|
36
|
+
console.log(`Total active prompts: ${prompts.length}`);
|
|
37
|
+
|
|
38
|
+
// Format a prompt with category names
|
|
39
|
+
const formattedPrompt = formatPrompt(prompts[0]);
|
|
40
|
+
console.log(formattedPrompt);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Filter by Category
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
import { getPromptsByCategoryId } from '@productstage/prompts-data';
|
|
47
|
+
|
|
48
|
+
// Get prompts for jewelry (category ID 11)
|
|
49
|
+
const jewelryPrompts = getPromptsByCategoryId(11);
|
|
50
|
+
jewelryPrompts.forEach(prompt => {
|
|
51
|
+
console.log(`${prompt.variant}: ${prompt.template}`);
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Advanced Querying
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { getPromptsWithCategories } from '@productstage/prompts-data';
|
|
59
|
+
|
|
60
|
+
// Get all hero prompts for jewelry
|
|
61
|
+
const heroPrompts = getPromptsWithCategories({
|
|
62
|
+
mainCategory: 'jewelry',
|
|
63
|
+
variant: 'Hero',
|
|
64
|
+
activeOnly: true
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Get prompts for specific subcategory
|
|
68
|
+
const necklacePrompts = getPromptsWithCategories({
|
|
69
|
+
subCategory: 'necklace',
|
|
70
|
+
activeOnly: true
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// Find categories by keyword
|
|
74
|
+
import { findCategoriesByKeyword } from '@productstage/prompts-data';
|
|
75
|
+
const handmadeCategories = findCategoriesByKeyword('handmade');
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Random Prompts
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
import { getRandomPrompts, getRandomPromptsByCategory } from '@productstage/prompts-data';
|
|
82
|
+
|
|
83
|
+
// Get 5 random prompts
|
|
84
|
+
const randomPrompts = getRandomPrompts(5);
|
|
85
|
+
|
|
86
|
+
// Get 3 random prompts for watches
|
|
87
|
+
const randomWatchPrompts = getRandomPromptsByCategory(8, 3);
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Custom Formatting
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
import { formatPromptWithNames } from '@productstage/prompts-data';
|
|
94
|
+
|
|
95
|
+
// Use a prompt template with custom product names
|
|
96
|
+
const prompt = {
|
|
97
|
+
id: 1,
|
|
98
|
+
productCategoryId: 7,
|
|
99
|
+
template: '{main_category} {sub_category} on a marble surface...',
|
|
100
|
+
variant: 'Custom',
|
|
101
|
+
isActive: true
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const customPrompt = formatPromptWithNames(
|
|
105
|
+
prompt,
|
|
106
|
+
'luxury watch',
|
|
107
|
+
'gold automatic'
|
|
108
|
+
);
|
|
109
|
+
console.log(customPrompt);
|
|
110
|
+
// Output: "luxury watch gold automatic on a marble surface..."
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## API Reference
|
|
114
|
+
|
|
115
|
+
### Functions
|
|
116
|
+
|
|
117
|
+
#### `getAllCategories(): ProductCategory[]`
|
|
118
|
+
Returns all available product categories.
|
|
119
|
+
|
|
120
|
+
#### `getCategoryById(id: number): ProductCategory | undefined`
|
|
121
|
+
Returns a category by its ID.
|
|
122
|
+
|
|
123
|
+
#### `findCategoriesByMainCategory(mainCategory: string): ProductCategory[]`
|
|
124
|
+
Finds categories by main category name (case-insensitive).
|
|
125
|
+
|
|
126
|
+
#### `findCategoriesByKeyword(keyword: string): ProductCategory[]`
|
|
127
|
+
Finds categories matching a keyword in main category, subcategory, or keywords array.
|
|
128
|
+
|
|
129
|
+
#### `getAllPrompts(): ProductPrompt[]`
|
|
130
|
+
Returns all prompt templates.
|
|
131
|
+
|
|
132
|
+
#### `getPromptsWithCategories(options?: PromptQueryOptions): PromptWithCategory[]`
|
|
133
|
+
Returns prompts with category information, optionally filtered.
|
|
134
|
+
|
|
135
|
+
**Options:**
|
|
136
|
+
- `categoryId?: number` - Filter by category ID
|
|
137
|
+
- `mainCategory?: string` - Filter by main category name
|
|
138
|
+
- `subCategory?: string` - Filter by subcategory name
|
|
139
|
+
- `variant?: string` - Filter by variant name (partial match)
|
|
140
|
+
- `activeOnly?: boolean` - Return only active prompts
|
|
141
|
+
- `keywords?: string[]` - Filter by category keywords
|
|
142
|
+
|
|
143
|
+
#### `getPromptsByCategoryId(categoryId: number, activeOnly?: boolean): ProductPrompt[]`
|
|
144
|
+
Returns all prompts for a specific category.
|
|
145
|
+
|
|
146
|
+
#### `getRandomPrompts(count: number, activeOnly?: boolean): ProductPrompt[]`
|
|
147
|
+
Returns random prompts from the collection.
|
|
148
|
+
|
|
149
|
+
#### `getRandomPromptsByCategory(categoryId: number, count: number, activeOnly?: boolean): ProductPrompt[]`
|
|
150
|
+
Returns random prompts for a specific category.
|
|
151
|
+
|
|
152
|
+
#### `formatPrompt(prompt: ProductPrompt): string`
|
|
153
|
+
Formats a prompt template by replacing `{main_category}` and `{sub_category}` placeholders with actual category names.
|
|
154
|
+
|
|
155
|
+
#### `formatPromptWithNames(prompt: ProductPrompt, mainCategory: string, subCategory?: string): string`
|
|
156
|
+
Formats a prompt template with custom category names.
|
|
157
|
+
|
|
158
|
+
## Data Structure
|
|
159
|
+
|
|
160
|
+
### ProductCategory
|
|
161
|
+
```typescript
|
|
162
|
+
interface ProductCategory {
|
|
163
|
+
id: number;
|
|
164
|
+
mainCategory: string;
|
|
165
|
+
subCategory: string | null;
|
|
166
|
+
keywords: string[];
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### ProductPrompt
|
|
171
|
+
```typescript
|
|
172
|
+
interface ProductPrompt {
|
|
173
|
+
id: number;
|
|
174
|
+
productCategoryId: number;
|
|
175
|
+
template: string;
|
|
176
|
+
variant: string;
|
|
177
|
+
isActive: boolean;
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### PromptWithCategory
|
|
182
|
+
```typescript
|
|
183
|
+
interface PromptWithCategory extends ProductPrompt {
|
|
184
|
+
category: ProductCategory;
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Supported Categories
|
|
189
|
+
|
|
190
|
+
The package includes prompts for the following product categories:
|
|
191
|
+
|
|
192
|
+
- **Bags**: Shoulder bags, handbags
|
|
193
|
+
- **Furniture**: Lounge chairs, home furniture
|
|
194
|
+
- **Apparel**: Hats, clothing
|
|
195
|
+
- **Accessories**: Fashion accessories
|
|
196
|
+
- **Shoes**: Hiking boots, footwear
|
|
197
|
+
- **Watches**: Bracelet watches, timepieces
|
|
198
|
+
- **Jewelry**: Necklaces, bracelets, rings, earrings
|
|
199
|
+
- **Handmade**: Ceramics, textiles, leather goods, woodwork
|
|
200
|
+
- **Household**: Cleaning brushes, home items
|
|
201
|
+
- **Beauty Tools**: Face mask bowls, cosmetic tools
|
|
202
|
+
- **Kitchenware**: Cutting boards, cookware
|
|
203
|
+
- **Home Decor**: Decorative bowls, vases
|
|
204
|
+
- **Lighting**: Wall sconces, fixtures
|
|
205
|
+
- **Home Organization**: Bookends, storage
|
|
206
|
+
- **Headwear**: Caps, hats
|
|
207
|
+
- **Clothing**: Men's shirts
|
|
208
|
+
- **Toys**: Wooden models, playthings
|
|
209
|
+
- **Home Appliances**: Humidifiers, electronics
|
|
210
|
+
- **Electronics**: Headphones, tech accessories
|
|
211
|
+
|
|
212
|
+
## Use Cases
|
|
213
|
+
|
|
214
|
+
- **E-commerce Product Photography**: Generate professional product images for online stores
|
|
215
|
+
- **Etsy Sellers**: Create lifestyle shots for handmade items
|
|
216
|
+
- **Shopify Store Owners**: Produce consistent product imagery
|
|
217
|
+
- **Amazon Sellers**: Generate compliant product photos
|
|
218
|
+
- **Digital Marketers**: Create promotional product content
|
|
219
|
+
- **Design Agencies**: Quick prototyping for product photography concepts
|
|
220
|
+
|
|
221
|
+
## Examples
|
|
222
|
+
|
|
223
|
+
### Generate Product Images with AI
|
|
224
|
+
|
|
225
|
+
```typescript
|
|
226
|
+
import { getPromptsByCategoryId, formatPrompt } from '@productstage/prompts-data';
|
|
227
|
+
|
|
228
|
+
// Get prompts for necklace
|
|
229
|
+
const necklacePrompts = getPromptsByCategoryId(11);
|
|
230
|
+
const selectedPrompt = necklacePrompts[0];
|
|
231
|
+
|
|
232
|
+
// Format and use with AI image generation
|
|
233
|
+
const aiPrompt = formatPrompt(selectedPrompt);
|
|
234
|
+
console.log(aiPrompt);
|
|
235
|
+
|
|
236
|
+
// Now use aiPrompt with your preferred AI image generation API
|
|
237
|
+
// e.g., OpenAI DALL-E, Stability AI, Midjourney, etc.
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Build a Product Photography Generator
|
|
241
|
+
|
|
242
|
+
```typescript
|
|
243
|
+
import {
|
|
244
|
+
getAllCategories,
|
|
245
|
+
getRandomPromptsByCategory
|
|
246
|
+
} from '@productstage/prompts-data';
|
|
247
|
+
|
|
248
|
+
function generateProductImage(categoryName: string) {
|
|
249
|
+
const categories = getAllCategories();
|
|
250
|
+
const category = categories.find(c =>
|
|
251
|
+
c.mainCategory.toLowerCase() === categoryName.toLowerCase()
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
if (!category) {
|
|
255
|
+
throw new Error('Category not found');
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const prompt = getRandomPromptsByCategory(category.id, 1)[0];
|
|
259
|
+
return prompt.template
|
|
260
|
+
.replace(/{main_category}/g, category.mainCategory)
|
|
261
|
+
.replace(/{sub_category}/g, category.subCategory || '');
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// Usage
|
|
265
|
+
const imagePrompt = generateProductImage('jewelry');
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## License
|
|
269
|
+
|
|
270
|
+
MIT
|
|
271
|
+
|
|
272
|
+
## Author
|
|
273
|
+
|
|
274
|
+
ProductStage.ai - Professional AI Product Photography Tools
|
|
275
|
+
|
|
276
|
+
## Links
|
|
277
|
+
|
|
278
|
+
- [ProductStage.ai](https://productstage.ai)
|
|
279
|
+
- [GitHub Repository](https://github.com/LueYueqing/productstage.ai)
|
|
280
|
+
- [Issues](https://github.com/LueYueqing/productstage.ai/issues)
|
|
281
|
+
|
|
282
|
+
## Contributing
|
|
283
|
+
|
|
284
|
+
We welcome contributions! If you have improvements or new prompt templates, please:
|
|
285
|
+
|
|
286
|
+
1. Fork the repository
|
|
287
|
+
2. Create a feature branch
|
|
288
|
+
3. Make your changes
|
|
289
|
+
4. Submit a pull request
|
|
290
|
+
|
|
291
|
+
## Support
|
|
292
|
+
|
|
293
|
+
For issues, questions, or suggestions, please open an issue on GitHub or visit [ProductStage.ai](https://productstage.ai).
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.categories = void 0;
|
|
4
|
+
exports.categories = [
|
|
5
|
+
{
|
|
6
|
+
"id": 1,
|
|
7
|
+
"mainCategory": "bags",
|
|
8
|
+
"subCategory": "shoulder bags",
|
|
9
|
+
"keywords": ["bags", "shoulder bags"]
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": 2,
|
|
13
|
+
"mainCategory": "furniture",
|
|
14
|
+
"subCategory": "lounge chair",
|
|
15
|
+
"keywords": ["furniture", "lounge chair"]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": 4,
|
|
19
|
+
"mainCategory": "apparel",
|
|
20
|
+
"subCategory": "hats",
|
|
21
|
+
"keywords": ["apparel", "hats"]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": 5,
|
|
25
|
+
"mainCategory": "accessories",
|
|
26
|
+
"subCategory": "hats",
|
|
27
|
+
"keywords": ["accessories", "hats"]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": 6,
|
|
31
|
+
"mainCategory": "shoes",
|
|
32
|
+
"subCategory": "hiking boots",
|
|
33
|
+
"keywords": ["shoes", "hiking boots"]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": 7,
|
|
37
|
+
"mainCategory": "universal",
|
|
38
|
+
"subCategory": null,
|
|
39
|
+
"keywords": []
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"id": 8,
|
|
43
|
+
"mainCategory": "watches",
|
|
44
|
+
"subCategory": "bracelet watches",
|
|
45
|
+
"keywords": ["watches", "bracelet watches"]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": 10,
|
|
49
|
+
"mainCategory": "footwear",
|
|
50
|
+
"subCategory": "slippers",
|
|
51
|
+
"keywords": ["footwear", "slippers"]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"id": 11,
|
|
55
|
+
"mainCategory": "jewelry",
|
|
56
|
+
"subCategory": "necklace",
|
|
57
|
+
"keywords": ["jewelry", "necklace"]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": 12,
|
|
61
|
+
"mainCategory": "jewelry",
|
|
62
|
+
"subCategory": "bracelet",
|
|
63
|
+
"keywords": ["jewelry", "bracelet", "bangle", "wrist wear"]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": 13,
|
|
67
|
+
"mainCategory": "jewelry",
|
|
68
|
+
"subCategory": "ring",
|
|
69
|
+
"keywords": ["jewelry", "ring", "finger ring", "band"]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"id": 14,
|
|
73
|
+
"mainCategory": "handmade",
|
|
74
|
+
"subCategory": "ceramic",
|
|
75
|
+
"keywords": ["handmade", "ceramic", "pottery", "artisan bowl", "handmade vase", "dinnerware"]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"id": 15,
|
|
79
|
+
"mainCategory": "handmade",
|
|
80
|
+
"subCategory": "textile",
|
|
81
|
+
"keywords": ["handmade", "knitted", "crochet", "textile", "chunky knit", "blanket", "scarf"]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"id": 16,
|
|
85
|
+
"mainCategory": "handmade",
|
|
86
|
+
"subCategory": "leather",
|
|
87
|
+
"keywords": ["handmade", "leather", "leather wallet", "leather bag", "vegetable tanned"]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"id": 17,
|
|
91
|
+
"mainCategory": "handmade",
|
|
92
|
+
"subCategory": "woodwork",
|
|
93
|
+
"keywords": ["handmade", "wood", "wooden", "cutting board", "live edge", "charcuterie board"]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": 18,
|
|
97
|
+
"mainCategory": "jewelry",
|
|
98
|
+
"subCategory": "earrings",
|
|
99
|
+
"keywords": ["jewelry", "earrings", "hoop earrings", "stud earrings", "dangle earrings"]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"id": 19,
|
|
103
|
+
"mainCategory": "household",
|
|
104
|
+
"subCategory": "cleaning brush",
|
|
105
|
+
"keywords": ["household", "cleaning brush"]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": 20,
|
|
109
|
+
"mainCategory": "beauty tools",
|
|
110
|
+
"subCategory": "face mask bowl and brush set",
|
|
111
|
+
"keywords": ["beauty tools", "face mask bowl and brush set"]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"id": 21,
|
|
115
|
+
"mainCategory": "kitchenware",
|
|
116
|
+
"subCategory": "cutting board",
|
|
117
|
+
"keywords": ["kitchenware", "cutting board"]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"id": 22,
|
|
121
|
+
"mainCategory": "home decor",
|
|
122
|
+
"subCategory": "decorative bowls and vases",
|
|
123
|
+
"keywords": ["home decor", "decorative bowls and vases"]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"id": 23,
|
|
127
|
+
"mainCategory": "lighting",
|
|
128
|
+
"subCategory": "wall sconce",
|
|
129
|
+
"keywords": ["lighting", "wall sconce"]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"id": 24,
|
|
133
|
+
"mainCategory": "home organization",
|
|
134
|
+
"subCategory": "bookends",
|
|
135
|
+
"keywords": ["home organization", "bookends"]
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"id": 25,
|
|
139
|
+
"mainCategory": "headwear",
|
|
140
|
+
"subCategory": "caps",
|
|
141
|
+
"keywords": ["headwear", "caps"]
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"id": 26,
|
|
145
|
+
"mainCategory": "clothing",
|
|
146
|
+
"subCategory": "men's shirts",
|
|
147
|
+
"keywords": ["clothing", "men's shirts"]
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"id": 27,
|
|
151
|
+
"mainCategory": "toys",
|
|
152
|
+
"subCategory": "wooden model airplane",
|
|
153
|
+
"keywords": ["toys", "wooden model airplane"]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"id": 28,
|
|
157
|
+
"mainCategory": "home appliances",
|
|
158
|
+
"subCategory": "humidifiers",
|
|
159
|
+
"keywords": ["home appliances", "humidifiers"]
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"id": 29,
|
|
163
|
+
"mainCategory": "electronics",
|
|
164
|
+
"subCategory": "headphones",
|
|
165
|
+
"keywords": ["electronics", "headphones"]
|
|
166
|
+
}
|
|
167
|
+
];
|