@umituz/react-native-ai-generation-content 1.17.232 → 1.17.234
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 +236 -261
- package/package.json +2 -2
- package/src/domains/content-moderation/README.md +239 -296
- package/src/domains/creations/README.md +242 -325
- package/src/domains/face-detection/README.md +228 -307
- package/src/domains/prompts/README.md +242 -312
- package/src/domains/result-preview/index.ts +8 -0
- package/src/domains/result-preview/presentation/components/ResultActionBar.tsx +74 -0
- package/src/domains/result-preview/presentation/components/ResultImageCard.tsx +64 -0
- package/src/domains/result-preview/presentation/components/ResultPreviewScreen.tsx +101 -0
- package/src/domains/result-preview/presentation/components/index.ts +7 -0
- package/src/domains/result-preview/presentation/hooks/index.ts +5 -0
- package/src/domains/result-preview/presentation/hooks/useResultActions.ts +148 -0
- package/src/domains/result-preview/presentation/types/index.ts +5 -0
- package/src/domains/result-preview/presentation/types/result-preview.types.ts +146 -0
- package/src/features/ai-hug/README.md +381 -219
- package/src/features/ai-kiss/README.md +388 -219
- package/src/features/anime-selfie/README.md +327 -256
- package/src/features/audio-generation/README.md +352 -309
- package/src/features/colorization/README.md +332 -228
- package/src/features/couple-future/README.md +387 -212
- package/src/features/future-prediction/README.md +391 -221
- package/src/features/hd-touch-up/README.md +339 -252
- package/src/features/image-captioning/README.md +359 -299
- package/src/features/image-to-image/README.md +398 -357
- package/src/features/image-to-video/README.md +337 -292
- package/src/features/inpainting/README.md +348 -244
- package/src/features/meme-generator/README.md +350 -269
- package/src/features/remove-background/README.md +335 -234
- package/src/features/remove-object/README.md +341 -288
- package/src/features/replace-background/README.md +353 -236
- package/src/features/script-generator/README.md +358 -287
- package/src/features/shared/README.md +254 -223
- package/src/features/sketch-to-image/README.md +331 -234
- package/src/features/style-transfer/README.md +336 -237
- package/src/features/text-to-video/README.md +360 -193
- package/src/features/text-to-voice/README.md +382 -272
- package/src/index.ts +3 -0
|
@@ -1,276 +1,438 @@
|
|
|
1
|
-
# AI Hug
|
|
1
|
+
# AI Hug Feature
|
|
2
2
|
|
|
3
3
|
Generate AI-powered hug images between two people.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 📍 Import Path
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- Support for various hug types
|
|
11
|
-
- High-quality facial matching
|
|
7
|
+
```typescript
|
|
8
|
+
import { useAIHugFeature } from '@umituz/react-native-ai-generation-content';
|
|
9
|
+
```
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
**Location**: `src/features/ai-hug/`
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
## 🎯 Feature Purpose
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
npm install @umituz/react-native-ai-generation-content
|
|
19
|
-
```
|
|
15
|
+
Create realistic hug images by combining two photos using AI. Automatically detects poses, positions arms naturally, and generates high-quality facial matching for various hug types.
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
---
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
## 📋 Usage Strategy
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
import { useAIHugFeature } from '@umituz/react-native-ai-generation-content';
|
|
27
|
-
import * as ImagePicker from 'react-native-image-picker';
|
|
28
|
-
|
|
29
|
-
function AIHugScreen() {
|
|
30
|
-
const [person1, setPerson1] = useState<string | null>(null);
|
|
31
|
-
const [person2, setPerson2] = useState<string | null>(null);
|
|
32
|
-
|
|
33
|
-
const feature = useAIHugFeature({
|
|
34
|
-
config: {
|
|
35
|
-
hugType: 'romantic',
|
|
36
|
-
onProcessingStart: () => console.log('Generating hug...'),
|
|
37
|
-
onProcessingComplete: (result) => console.log('Complete:', result),
|
|
38
|
-
onError: (error) => console.error('Error:', error),
|
|
39
|
-
},
|
|
40
|
-
onSelectPerson1: async () => {
|
|
41
|
-
const result = await ImagePicker.launchImageLibrary({ mediaType: 'photo' });
|
|
42
|
-
if (result.assets && result.assets[0].uri) {
|
|
43
|
-
const base64 = await convertToBase64(result.assets[0].uri);
|
|
44
|
-
setPerson1(base64);
|
|
45
|
-
return base64;
|
|
46
|
-
}
|
|
47
|
-
return null;
|
|
48
|
-
},
|
|
49
|
-
onSelectPerson2: async () => {
|
|
50
|
-
const result = await ImagePicker.launchImageLibrary({ mediaType: 'photo' });
|
|
51
|
-
if (result.assets && result.assets[0].uri) {
|
|
52
|
-
const base64 = await convertToBase64(result.assets[0].uri);
|
|
53
|
-
setPerson2(base64);
|
|
54
|
-
return base64;
|
|
55
|
-
}
|
|
56
|
-
return null;
|
|
57
|
-
},
|
|
58
|
-
onSaveResult: async (imageUrl) => {
|
|
59
|
-
await saveToGallery(imageUrl);
|
|
60
|
-
},
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<View>
|
|
65
|
-
<DualImagePicker
|
|
66
|
-
sourceImage={person1}
|
|
67
|
-
targetImage={person2}
|
|
68
|
-
onSelectSourceImage={feature.selectPerson1}
|
|
69
|
-
onSelectTargetImage={feature.selectPerson2}
|
|
70
|
-
sourceLabel="Person 1"
|
|
71
|
-
targetLabel="Person 2"
|
|
72
|
-
/>
|
|
73
|
-
|
|
74
|
-
<HugTypeSelector
|
|
75
|
-
selectedType={feature.state.hugType}
|
|
76
|
-
onSelectType={feature.setHugType}
|
|
77
|
-
/>
|
|
78
|
-
|
|
79
|
-
<Button
|
|
80
|
-
title="Generate AI Hug"
|
|
81
|
-
onPress={feature.process}
|
|
82
|
-
disabled={!feature.isReady || feature.state.isProcessing}
|
|
83
|
-
/>
|
|
84
|
-
|
|
85
|
-
{feature.state.isProcessing && (
|
|
86
|
-
<View>
|
|
87
|
-
<Text>Creating your hug image...</Text>
|
|
88
|
-
<ProgressBar progress={feature.state.progress} />
|
|
89
|
-
</View>
|
|
90
|
-
)}
|
|
91
|
-
|
|
92
|
-
{feature.state.result && (
|
|
93
|
-
<Image source={{ uri: feature.state.result.imageUrl }} />
|
|
94
|
-
)}
|
|
95
|
-
</View>
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
```
|
|
21
|
+
### When to Use This Feature
|
|
99
22
|
|
|
100
|
-
|
|
23
|
+
✅ **Use Cases:**
|
|
24
|
+
- Creating couple photos
|
|
25
|
+
- Generating family moments
|
|
26
|
+
- Fun friendship images
|
|
27
|
+
- Social media content
|
|
28
|
+
- Creative personal projects
|
|
101
29
|
|
|
102
|
-
|
|
103
|
-
|
|
30
|
+
❌ **When NOT to Use:**
|
|
31
|
+
- Non-consensual image generation
|
|
32
|
+
- Misleading or deceptive content
|
|
33
|
+
- Harassment or bullying
|
|
34
|
+
- Commercial use without permissions
|
|
104
35
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
36
|
+
### Implementation Strategy
|
|
37
|
+
|
|
38
|
+
1. **Select TWO photos** (person 1 and person 2)
|
|
39
|
+
2. **Choose hug type** (romantic, friendly, family, cute)
|
|
40
|
+
3. **Validate both photos** before generation
|
|
41
|
+
4. **Generate AI hug** with progress tracking
|
|
42
|
+
5. **Preview result** and offer regeneration
|
|
43
|
+
6. **Save or share** the final image
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## ⚠️ Critical Rules (MUST FOLLOW)
|
|
48
|
+
|
|
49
|
+
### 1. Image Requirements
|
|
50
|
+
- **MUST** provide TWO distinct images (person 1 + person 2)
|
|
51
|
+
- **MUST** contain at least one visible person in each image
|
|
52
|
+
- **MUST** use high-quality images (min 512x512 recommended)
|
|
53
|
+
- **MUST** ensure faces are clearly visible
|
|
54
|
+
- **MUST NOT** use images with no detectable people
|
|
55
|
+
|
|
56
|
+
### 2. Configuration
|
|
57
|
+
- **MUST** provide valid `userId` for tracking
|
|
58
|
+
- **MUST** specify `hugType` (romantic, friendly, family, cute)
|
|
59
|
+
- **MUST** implement `onError` callback
|
|
60
|
+
- **MUST** implement `onSelectPerson1` and `onSelectPerson2` callbacks
|
|
61
|
+
- **MUST** handle both images being selected before processing
|
|
62
|
+
|
|
63
|
+
### 3. State Management
|
|
64
|
+
- **MUST** check `isReady` before enabling generate button
|
|
65
|
+
- **MUST** verify both images are selected
|
|
66
|
+
- **MUST** handle `isProcessing` state to prevent duplicate requests
|
|
67
|
+
- **MUST** display `error` state to users
|
|
68
|
+
- **MUST** implement proper cleanup on unmount
|
|
69
|
+
|
|
70
|
+
### 4. Performance
|
|
71
|
+
- **MUST** limit image size (<10MB each)
|
|
72
|
+
- **MUST** compress images before processing
|
|
73
|
+
- **MUST** implement loading indicators during processing
|
|
74
|
+
- **MUST** cache results locally
|
|
75
|
+
- **MUST NOT** generate multiple hugs simultaneously
|
|
76
|
+
|
|
77
|
+
### 5. Ethics & Privacy
|
|
78
|
+
- **MUST** obtain consent from people whose photos are used
|
|
79
|
+
- **MUST** provide clear usage terms
|
|
80
|
+
- **MUST** implement content moderation
|
|
81
|
+
- **MUST** prevent malicious use cases
|
|
82
|
+
- **MUST** log processing for audit trail
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 🚫 Prohibitions (MUST AVOID)
|
|
87
|
+
|
|
88
|
+
### Strictly Forbidden
|
|
89
|
+
|
|
90
|
+
❌ **NEVER** do the following:
|
|
91
|
+
|
|
92
|
+
1. **No Single Image**
|
|
93
|
+
- Always requires TWO images (person 1 + person 2)
|
|
94
|
+
- Never attempt with missing image
|
|
95
|
+
|
|
96
|
+
2. **No Non-Consensual Generation**
|
|
97
|
+
- Always obtain permission from subjects
|
|
98
|
+
- Never generate hugs without consent
|
|
99
|
+
- Implement age verification for minors
|
|
100
|
+
|
|
101
|
+
3. **No Malicious Use**
|
|
102
|
+
- Never use for harassment or bullying
|
|
103
|
+
- Never create misleading content
|
|
104
|
+
- Never use for deception
|
|
105
|
+
|
|
106
|
+
4. **No Unhandled Errors**
|
|
107
|
+
- Never ignore generation failures
|
|
108
|
+
- Always handle detection errors gracefully
|
|
109
|
+
- Provide clear error messages
|
|
110
|
+
|
|
111
|
+
5. **No Memory Leaks**
|
|
112
|
+
- Never store large images in state unnecessarily
|
|
113
|
+
- Always cleanup image references on unmount
|
|
114
|
+
- Implement proper image disposal
|
|
115
|
+
|
|
116
|
+
6. **No Blocked UI**
|
|
117
|
+
- Never process without user confirmation
|
|
118
|
+
- Always show progress indicator
|
|
119
|
+
- Never block main thread with image processing
|
|
120
|
+
|
|
121
|
+
7. **No Missing Context**
|
|
122
|
+
- Never confuse which person is which
|
|
123
|
+
- Always provide clear UI labels
|
|
124
|
+
- Show preview before processing
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 🤖 AI Agent Directions
|
|
129
|
+
|
|
130
|
+
### For AI Code Generation Tools
|
|
131
|
+
|
|
132
|
+
When using this feature with AI code generation tools, follow these guidelines:
|
|
133
|
+
|
|
134
|
+
#### Prompt Template for AI Agents
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
You are implementing an AI hug generation feature using @umituz/react-native-ai-generation-content.
|
|
138
|
+
|
|
139
|
+
REQUIREMENTS:
|
|
140
|
+
1. Import from: @umituz/react-native-ai-generation-content
|
|
141
|
+
2. Use the useAIHugFeature hook
|
|
142
|
+
3. Require TWO images (person 1 + person 2)
|
|
143
|
+
4. Implement dual image selection UI
|
|
144
|
+
5. Select hug type (romantic, friendly, family, cute)
|
|
145
|
+
6. Validate both images before generation
|
|
146
|
+
7. Add confirmation dialog before generation
|
|
147
|
+
8. Handle long processing times with progress
|
|
148
|
+
9. Implement proper error handling
|
|
149
|
+
10. Implement cleanup on unmount
|
|
150
|
+
|
|
151
|
+
CRITICAL RULES:
|
|
152
|
+
- MUST obtain consent from subjects
|
|
153
|
+
- MUST validate both images before processing
|
|
154
|
+
- MUST provide clear UI for person 1 vs person 2
|
|
155
|
+
- MUST handle generation errors gracefully
|
|
156
|
+
- MUST prevent malicious use cases
|
|
157
|
+
- MUST implement content moderation
|
|
158
|
+
- NEVER process without user confirmation
|
|
159
|
+
|
|
160
|
+
CONFIGURATION:
|
|
161
|
+
- Provide valid userId (string)
|
|
162
|
+
- Set hugType: 'romantic' | 'friendly' | 'family' | 'cute'
|
|
163
|
+
- Implement onSelectPerson1 callback
|
|
164
|
+
- Implement onSelectPerson2 callback
|
|
165
|
+
- Implement onSaveResult callback
|
|
166
|
+
- Configure callbacks: onProcessingStart, onProcessingComplete, onError
|
|
167
|
+
|
|
168
|
+
OPTIONS:
|
|
169
|
+
- hugType: Select hug style
|
|
170
|
+
- preserveFaces: boolean (maintain facial features)
|
|
171
|
+
- enhanceQuality: boolean (enhance output quality)
|
|
172
|
+
|
|
173
|
+
STRICTLY FORBIDDEN:
|
|
174
|
+
- No single image processing
|
|
175
|
+
- No non-consensual generation
|
|
176
|
+
- No malicious use
|
|
177
|
+
- No unhandled errors
|
|
178
|
+
- No memory leaks
|
|
179
|
+
- No missing UI context
|
|
180
|
+
|
|
181
|
+
ETHICS CHECKLIST:
|
|
182
|
+
- [ ] Consent mechanism implemented
|
|
183
|
+
- [ ] Age verification for minors
|
|
184
|
+
- [ ] Content moderation in place
|
|
185
|
+
- [ ] Usage terms provided
|
|
186
|
+
- [ ] Audit trail logging
|
|
187
|
+
- [ ] Report/flag functionality
|
|
113
188
|
```
|
|
114
189
|
|
|
115
|
-
|
|
190
|
+
#### AI Implementation Checklist
|
|
191
|
+
|
|
192
|
+
Use this checklist when generating code:
|
|
193
|
+
|
|
194
|
+
- [ ] Feature imported from correct path
|
|
195
|
+
- [ ] Dual image selection implemented
|
|
196
|
+
- [ ] Person 1/Person 2 labels clear
|
|
197
|
+
- [ ] Hug type selector added
|
|
198
|
+
- [ ] Both images validated before processing
|
|
199
|
+
- [ ] Confirmation dialog added
|
|
200
|
+
- [ ] Progress indicator during processing
|
|
201
|
+
- [ ] Error display with user-friendly message
|
|
202
|
+
- [ ] Result preview before saving
|
|
203
|
+
- [ ] Consent mechanism in place
|
|
204
|
+
- [ ] Cleanup on unmount
|
|
205
|
+
- [ ] Content moderation configured
|
|
116
206
|
|
|
117
|
-
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## 🛠️ Configuration Strategy
|
|
210
|
+
|
|
211
|
+
### Essential Configuration
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
// Required fields
|
|
215
|
+
{
|
|
216
|
+
userId: string
|
|
217
|
+
hugType: 'romantic' | 'friendly' | 'family' | 'cute'
|
|
218
|
+
onSelectPerson1: () => Promise<string | null>
|
|
219
|
+
onSelectPerson2: () => Promise<string | null>
|
|
220
|
+
}
|
|
118
221
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
onError?: (error: string) => void;
|
|
222
|
+
// Optional callbacks
|
|
223
|
+
{
|
|
224
|
+
onProcessingStart?: () => void
|
|
225
|
+
onProcessingComplete?: (result) => void
|
|
226
|
+
onError?: (error: string) => void
|
|
125
227
|
}
|
|
126
228
|
```
|
|
127
229
|
|
|
128
|
-
###
|
|
230
|
+
### Recommended Settings
|
|
129
231
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
232
|
+
1. **Hug Types**
|
|
233
|
+
- Romantic: Intimate couple hugs
|
|
234
|
+
- Friendly: Casual friendship hugs
|
|
235
|
+
- Family: Warm family embraces
|
|
236
|
+
- Cute: Adorable, playful hugs
|
|
237
|
+
|
|
238
|
+
2. **Image Quality**
|
|
239
|
+
- Minimum: 512x512 resolution
|
|
240
|
+
- Recommended: 1024x1024 or higher
|
|
241
|
+
- Format: JPEG or PNG
|
|
242
|
+
- Max size: 10MB per image
|
|
243
|
+
|
|
244
|
+
3. **Performance Settings**
|
|
245
|
+
- Compress images before upload
|
|
246
|
+
- Show progress for long operations
|
|
247
|
+
- Implement timeout (120s default)
|
|
248
|
+
- Enable result caching
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## 📊 State Management
|
|
253
|
+
|
|
254
|
+
### Feature States
|
|
255
|
+
|
|
256
|
+
**isReady**: boolean
|
|
257
|
+
- Both images selected and validated
|
|
258
|
+
- Check before enabling generate button
|
|
259
|
+
|
|
260
|
+
**isProcessing**: boolean
|
|
261
|
+
- AI hug generation in progress
|
|
262
|
+
- Show loading/progress indicator
|
|
263
|
+
- Disable generate button
|
|
264
|
+
|
|
265
|
+
**progress**: number (0-100)
|
|
266
|
+
- Generation progress percentage
|
|
267
|
+
- Update progress bar
|
|
268
|
+
|
|
269
|
+
**error**: string | null
|
|
270
|
+
- Error message if generation failed
|
|
271
|
+
- Common errors: "No person found in image", "Generation failed"
|
|
272
|
+
|
|
273
|
+
**result**: {
|
|
274
|
+
imageUrl: string
|
|
275
|
+
hugType?: string
|
|
276
|
+
metadata?: any
|
|
135
277
|
}
|
|
136
|
-
```
|
|
137
278
|
|
|
138
|
-
|
|
279
|
+
---
|
|
139
280
|
|
|
140
|
-
|
|
281
|
+
## 🔐 Ethics & Privacy
|
|
141
282
|
|
|
142
|
-
|
|
143
|
-
const result = await feature.process({
|
|
144
|
-
hugType: 'romantic',
|
|
145
|
-
});
|
|
146
|
-
```
|
|
283
|
+
### Consent Requirements
|
|
147
284
|
|
|
148
|
-
|
|
285
|
+
- **MUST** obtain explicit consent from all subjects
|
|
286
|
+
- **MUST** provide clear explanation of how images will be used
|
|
287
|
+
- **MUST** implement age verification
|
|
288
|
+
- **MUST** allow subjects to opt-out
|
|
149
289
|
|
|
150
|
-
|
|
151
|
-
const result = await feature.process({
|
|
152
|
-
hugType: 'friendly',
|
|
153
|
-
});
|
|
154
|
-
```
|
|
290
|
+
### Content Moderation
|
|
155
291
|
|
|
156
|
-
|
|
292
|
+
- **MUST** filter inappropriate content
|
|
293
|
+
- **MUST** prevent malicious use cases
|
|
294
|
+
- **MUST** implement reporting mechanism
|
|
295
|
+
- **MUST** review flagged content
|
|
157
296
|
|
|
158
|
-
|
|
159
|
-
const result = await feature.process({
|
|
160
|
-
hugType: 'family',
|
|
161
|
-
});
|
|
162
|
-
```
|
|
297
|
+
### Usage Guidelines
|
|
163
298
|
|
|
164
|
-
|
|
299
|
+
- **MUST** provide terms of service
|
|
300
|
+
- **MUST** clearly label AI-generated content
|
|
301
|
+
- **MUST** prevent deception/misrepresentation
|
|
302
|
+
- **MUST** comply with deepfake regulations
|
|
165
303
|
|
|
166
|
-
|
|
167
|
-
const result = await feature.process({
|
|
168
|
-
hugType: 'cute',
|
|
169
|
-
});
|
|
170
|
-
```
|
|
304
|
+
---
|
|
171
305
|
|
|
172
|
-
##
|
|
306
|
+
## 🎨 Best Practices
|
|
173
307
|
|
|
174
|
-
|
|
175
|
-
2. Select **Person 2** - Choose the second person's photo
|
|
176
|
-
3. Choose **Hug Type** - Select the style of hug
|
|
177
|
-
4. Tap **Generate** - Start the AI generation
|
|
178
|
-
5. View Result - See the generated hug image
|
|
179
|
-
6. Save or Share - Save to gallery or share
|
|
308
|
+
### Image Selection
|
|
180
309
|
|
|
181
|
-
|
|
310
|
+
1. **Photo Quality**
|
|
311
|
+
- Good: Clear, well-lit, high-resolution photos
|
|
312
|
+
- Bad: Blurry, dark, low-resolution images
|
|
182
313
|
|
|
183
|
-
|
|
314
|
+
2. **Pose Clarity**
|
|
315
|
+
- Good: Full-body or waist-up shots
|
|
316
|
+
- Bad: Extreme close-ups, obscured poses
|
|
184
317
|
|
|
185
|
-
|
|
186
|
-
|
|
318
|
+
3. **Face Visibility**
|
|
319
|
+
- Good: Clear, frontal face shots
|
|
320
|
+
- Bad: Occluded or profile faces
|
|
187
321
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
{ id: 'family', name: 'Family', preview: '...' },
|
|
192
|
-
{ id: 'cute', name: 'Cute', preview: '...' },
|
|
193
|
-
];
|
|
322
|
+
4. **Lighting**
|
|
323
|
+
- Similar lighting conditions work best
|
|
324
|
+
- Front-facing well-lit photos ideal
|
|
194
325
|
|
|
195
|
-
|
|
196
|
-
styles={hugTypes}
|
|
197
|
-
selectedStyle={selectedHugType}
|
|
198
|
-
onSelectStyle={setSelectedHugType}
|
|
199
|
-
/>
|
|
200
|
-
```
|
|
326
|
+
### User Experience
|
|
201
327
|
|
|
202
|
-
|
|
328
|
+
1. **Clear UI**
|
|
329
|
+
- Label person 1 vs person 2 clearly
|
|
330
|
+
- Show preview before processing
|
|
331
|
+
- Add confirmation dialog
|
|
203
332
|
|
|
204
|
-
|
|
205
|
-
|
|
333
|
+
2. **Error Handling**
|
|
334
|
+
- Explain "no person found" errors
|
|
335
|
+
- Provide troubleshooting tips
|
|
336
|
+
- Offer retry option
|
|
206
337
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
onShare={() => shareImage(feature.state.result.imageUrl)}
|
|
212
|
-
onRegenerate={() => feature.process()}
|
|
213
|
-
/>
|
|
214
|
-
)}
|
|
215
|
-
```
|
|
338
|
+
3. **Performance**
|
|
339
|
+
- Compress images before upload
|
|
340
|
+
- Show progress for long operations
|
|
341
|
+
- Cache results for re-download
|
|
216
342
|
|
|
217
|
-
|
|
343
|
+
---
|
|
218
344
|
|
|
219
|
-
|
|
220
|
-
2. **Full Body**: Photos showing full body work best
|
|
221
|
-
3. **Facing Forward**: Forward-facing photos produce better results
|
|
222
|
-
4. **Clear Faces**: Ensure both faces are clearly visible
|
|
223
|
-
5. **Similar Lighting**: Similar lighting in both photos creates more natural results
|
|
345
|
+
## 🐛 Common Pitfalls
|
|
224
346
|
|
|
225
|
-
|
|
347
|
+
### Detection Issues
|
|
226
348
|
|
|
227
|
-
|
|
349
|
+
❌ **Problem**: "No person found" error
|
|
350
|
+
✅ **Solution**: Ensure people are clearly visible, well-lit, frontal
|
|
228
351
|
|
|
229
|
-
|
|
230
|
-
// Create romantic hug images for couples
|
|
231
|
-
const result = await feature.process({
|
|
232
|
-
hugType: 'romantic',
|
|
233
|
-
preserveFaces: true,
|
|
234
|
-
});
|
|
235
|
-
```
|
|
352
|
+
### Quality Issues
|
|
236
353
|
|
|
237
|
-
|
|
354
|
+
❌ **Problem**: Poor quality generation
|
|
355
|
+
✅ **Solution**: Use higher resolution images, better lighting, try different hug type
|
|
238
356
|
|
|
239
|
-
|
|
240
|
-
// Generate family hug photos
|
|
241
|
-
const result = await feature.process({
|
|
242
|
-
hugType: 'family',
|
|
243
|
-
enhanceQuality: true,
|
|
244
|
-
});
|
|
245
|
-
```
|
|
357
|
+
### UX Confusion
|
|
246
358
|
|
|
247
|
-
|
|
359
|
+
❌ **Problem**: Users confused about which person is which
|
|
360
|
+
✅ **Solution**: Clear labels, visual indicators, preview
|
|
248
361
|
|
|
249
|
-
|
|
250
|
-
// Create fun hug images with friends
|
|
251
|
-
const result = await feature.process({
|
|
252
|
-
hugType: 'friendly',
|
|
253
|
-
});
|
|
254
|
-
```
|
|
362
|
+
### Privacy Concerns
|
|
255
363
|
|
|
256
|
-
|
|
364
|
+
❌ **Problem**: Non-consensual image generation
|
|
365
|
+
✅ **Solution**: Implement consent mechanisms, age verification
|
|
257
366
|
|
|
258
|
-
|
|
259
|
-
const { state, process } = useAIHugFeature({ ...config });
|
|
367
|
+
---
|
|
260
368
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
369
|
+
## 📦 Related Components
|
|
370
|
+
|
|
371
|
+
Use these components from the library:
|
|
372
|
+
|
|
373
|
+
- **DualImagePicker**: Select two images
|
|
374
|
+
- **HugTypeSelector**: Choose hug style
|
|
375
|
+
- **ResultImageCard**: Display result with actions
|
|
376
|
+
- **ConfirmationDialog**: Confirm before processing
|
|
377
|
+
|
|
378
|
+
Located at: `src/presentation/components/`
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
## 🔄 Migration Strategy
|
|
383
|
+
|
|
384
|
+
If migrating from previous implementation:
|
|
385
|
+
|
|
386
|
+
1. **Update imports** to new path
|
|
387
|
+
2. **Add dual image selection** (person 1 + person 2)
|
|
388
|
+
3. **Implement consent mechanism**
|
|
389
|
+
4. **Add hug type selector**
|
|
390
|
+
5. **Update state handling** for both images
|
|
391
|
+
6. **Test all error cases**
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
## ⚖️ Legal Considerations
|
|
396
|
+
|
|
397
|
+
### Compliance
|
|
398
|
+
|
|
399
|
+
- **Deepfake Regulations**: Comply with local laws
|
|
400
|
+
- **Privacy Laws**: GDPR, CCPA compliance
|
|
401
|
+
- **Consent Requirements**: Explicit permission needed
|
|
402
|
+
- **Age Restrictions**: Verify adult subjects
|
|
403
|
+
- **Content Labeling**: Mark as AI-generated
|
|
404
|
+
|
|
405
|
+
### Best Practices
|
|
406
|
+
|
|
407
|
+
- Provide attribution for source images
|
|
408
|
+
- Allow content reporting/flagging
|
|
409
|
+
- Implement audit trail logging
|
|
410
|
+
- Cooperate with takedown requests
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
414
|
+
## 📚 Additional Resources
|
|
415
|
+
|
|
416
|
+
- Main documentation: `/docs/`
|
|
417
|
+
- API reference: `/docs/api/`
|
|
418
|
+
- Examples: `/docs/examples/basic/ai-hug/`
|
|
419
|
+
- Ethics guidelines: `/docs/ethics.md`
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
**Last Updated**: 2025-01-08
|
|
424
|
+
**Version**: 2.0.0 (Strategy-based Documentation)
|
|
267
425
|
|
|
268
|
-
|
|
426
|
+
---
|
|
269
427
|
|
|
270
|
-
|
|
271
|
-
- [Couple Future](../couple-future) - Generate future couple predictions
|
|
272
|
-
- [Face Swap](../face-swap) - Swap faces between images
|
|
428
|
+
## 📝 Changelog
|
|
273
429
|
|
|
274
|
-
|
|
430
|
+
### v2.0.0 - 2025-01-08
|
|
431
|
+
- **BREAKING**: Documentation format changed to strategy-based
|
|
432
|
+
- Removed extensive code examples
|
|
433
|
+
- Added ethics and privacy guidelines
|
|
434
|
+
- Added rules, prohibitions, and AI agent directions
|
|
435
|
+
- Focus on responsible AI usage
|
|
275
436
|
|
|
276
|
-
|
|
437
|
+
### v1.0.0 - Initial Release
|
|
438
|
+
- Initial feature documentation
|