@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,325 +1,396 @@
|
|
|
1
|
-
# Anime Selfie
|
|
1
|
+
# Anime Selfie Feature
|
|
2
2
|
|
|
3
3
|
Convert photos to anime/manga style using AI.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 📍 Import Path
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- High-quality character preservation
|
|
11
|
-
- Customizable intensity levels
|
|
7
|
+
```typescript
|
|
8
|
+
import { useAnimeSelfieFeature } from '@umituz/react-native-ai-generation-content';
|
|
9
|
+
```
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
**Location**: `src/features/anime-selfie/`
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
## 🎯 Feature Purpose
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
npm install @umituz/react-native-ai-generation-content
|
|
19
|
-
```
|
|
15
|
+
Transform photos into anime/manga style artwork using AI. Supports various anime styles with customizable intensity levels while preserving facial features.
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
---
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
## 📋 Usage Strategy
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
import { useAnimeSelfieFeature } from '@umituz/react-native-ai-generation-content';
|
|
27
|
-
import * as ImagePicker from 'react-native-image-picker';
|
|
28
|
-
|
|
29
|
-
function AnimeSelfieScreen() {
|
|
30
|
-
const [photo, setPhoto] = useState<string | null>(null);
|
|
31
|
-
|
|
32
|
-
const feature = useAnimeSelfieFeature({
|
|
33
|
-
config: {
|
|
34
|
-
style: 'shonen',
|
|
35
|
-
intensity: 0.8,
|
|
36
|
-
onProcessingStart: () => console.log('Converting to anime...'),
|
|
37
|
-
onProcessingComplete: (result) => console.log('Complete:', result),
|
|
38
|
-
onError: (error) => console.error('Error:', error),
|
|
39
|
-
},
|
|
40
|
-
onSelectPhoto: 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
|
-
setPhoto(base64);
|
|
45
|
-
return base64;
|
|
46
|
-
}
|
|
47
|
-
return null;
|
|
48
|
-
},
|
|
49
|
-
onSaveResult: async (imageUrl) => {
|
|
50
|
-
await saveToGallery(imageUrl);
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<View>
|
|
56
|
-
<PhotoUploadCard
|
|
57
|
-
image={photo}
|
|
58
|
-
onSelectImage={feature.selectPhoto}
|
|
59
|
-
title="Select Photo to Convert"
|
|
60
|
-
/>
|
|
61
|
-
|
|
62
|
-
<AnimeStyleSelector
|
|
63
|
-
selectedStyle={feature.state.style}
|
|
64
|
-
onSelectStyle={feature.setStyle}
|
|
65
|
-
/>
|
|
66
|
-
|
|
67
|
-
<IntensitySlider
|
|
68
|
-
value={feature.state.intensity}
|
|
69
|
-
onChange={feature.setIntensity}
|
|
70
|
-
/>
|
|
71
|
-
|
|
72
|
-
<Button
|
|
73
|
-
title="Convert to Anime"
|
|
74
|
-
onPress={feature.process}
|
|
75
|
-
disabled={!feature.isReady || feature.state.isProcessing}
|
|
76
|
-
/>
|
|
77
|
-
|
|
78
|
-
{feature.state.isProcessing && (
|
|
79
|
-
<ActivityIndicator />
|
|
80
|
-
)}
|
|
81
|
-
|
|
82
|
-
{feature.state.result && (
|
|
83
|
-
<ResultDisplay
|
|
84
|
-
originalImage={photo}
|
|
85
|
-
resultImage={feature.state.result.imageUrl}
|
|
86
|
-
onSave={() => feature.saveResult()}
|
|
87
|
-
/>
|
|
88
|
-
)}
|
|
89
|
-
</View>
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
```
|
|
21
|
+
### When to Use This Feature
|
|
93
22
|
|
|
94
|
-
|
|
23
|
+
✅ **Use Cases:**
|
|
24
|
+
- Creating anime avatars
|
|
25
|
+
- Generating manga-style portraits
|
|
26
|
+
- Artistic photo transformations
|
|
27
|
+
- Social media profile pictures
|
|
28
|
+
- Fan art and creative projects
|
|
95
29
|
|
|
96
|
-
|
|
97
|
-
|
|
30
|
+
❌ **When NOT to Use:**
|
|
31
|
+
- General artistic style transfer (use Style Transfer)
|
|
32
|
+
- Face swapping (use Face Swap)
|
|
33
|
+
- Image editing and filters (use image editing software)
|
|
34
|
+
- Copyrighted character replication
|
|
98
35
|
|
|
99
|
-
|
|
100
|
-
return (
|
|
101
|
-
<AIFeatureScreen
|
|
102
|
-
featureId="anime-selfie"
|
|
103
|
-
userId="user-123"
|
|
104
|
-
/>
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
```
|
|
36
|
+
### Implementation Strategy
|
|
108
37
|
|
|
109
|
-
|
|
38
|
+
1. **Select photo** to convert to anime
|
|
39
|
+
2. **Choose anime style** (shonen, shojo, chibi, etc.)
|
|
40
|
+
3. **Adjust intensity** level (0.0 to 1.0)
|
|
41
|
+
4. **Generate anime version** with progress tracking
|
|
42
|
+
5. **Preview and compare** with original
|
|
43
|
+
6. **Save or share** result
|
|
110
44
|
|
|
111
|
-
|
|
45
|
+
---
|
|
112
46
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
47
|
+
## ⚠️ Critical Rules (MUST FOLLOW)
|
|
48
|
+
|
|
49
|
+
### 1. Image Requirements
|
|
50
|
+
- **MUST** provide ONE image to convert
|
|
51
|
+
- **MUST** use clear, well-lit photos
|
|
52
|
+
- **MUST** have visible faces (for best results)
|
|
53
|
+
- **MUST** use reasonable resolution (min 512x512)
|
|
54
|
+
- **MUST NOT** exceed file size limits (10MB max)
|
|
55
|
+
|
|
56
|
+
### 2. Configuration
|
|
57
|
+
- **MUST** provide valid `userId` for tracking
|
|
58
|
+
- **MUST** specify `style` (anime style type)
|
|
59
|
+
- **MUST** set `intensity` level (0.0 to 1.0)
|
|
60
|
+
- **MUST** implement `onError` callback
|
|
61
|
+
- **MUST** implement `onSelectPhoto` callback
|
|
62
|
+
|
|
63
|
+
### 3. State Management
|
|
64
|
+
- **MUST** check `isReady` before enabling convert button
|
|
65
|
+
- **MUST** display progress during conversion
|
|
66
|
+
- **MUST** handle long processing times
|
|
67
|
+
- **MUST** display `error` state with clear messages
|
|
68
|
+
- **MUST** implement proper cleanup on unmount
|
|
69
|
+
|
|
70
|
+
### 4. Performance
|
|
71
|
+
- **MUST** implement image compression before upload
|
|
72
|
+
- **MUST** show progress indicator for processing
|
|
73
|
+
- **MUST** cache results locally
|
|
74
|
+
- **MUST** allow users to cancel processing
|
|
75
|
+
- **MUST NOT** convert multiple images simultaneously
|
|
76
|
+
|
|
77
|
+
### 5. Content Quality
|
|
78
|
+
- **MUST** provide before/after comparison
|
|
79
|
+
- **MUST** allow intensity adjustment
|
|
80
|
+
- **MUST** handle various photo types
|
|
81
|
+
- **MUST** preserve facial features when enabled
|
|
82
|
+
- **MUST** offer style regeneration
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 🚫 Prohibitions (MUST AVOID)
|
|
87
|
+
|
|
88
|
+
### Strictly Forbidden
|
|
89
|
+
|
|
90
|
+
❌ **NEVER** do the following:
|
|
91
|
+
|
|
92
|
+
1. **No Missing Images**
|
|
93
|
+
- Always validate image is selected
|
|
94
|
+
- Never call process() without image
|
|
95
|
+
|
|
96
|
+
2. **No Auto-Processing**
|
|
97
|
+
- Never start conversion without user action
|
|
98
|
+
- Always require explicit "Convert" button press
|
|
99
|
+
- Show preview before processing
|
|
100
|
+
|
|
101
|
+
3. **No Hardcoded Credentials**
|
|
102
|
+
- Never store API keys in component files
|
|
103
|
+
- Use environment variables or secure storage
|
|
104
|
+
|
|
105
|
+
4. **No Unhandled Errors**
|
|
106
|
+
- Never ignore conversion failures
|
|
107
|
+
- Always explain what went wrong
|
|
108
|
+
- Provide retry or alternative options
|
|
109
|
+
|
|
110
|
+
5. **No Memory Leaks**
|
|
111
|
+
- Never store both original and converted large images simultaneously
|
|
112
|
+
- Clean up temporary images
|
|
113
|
+
- Implement proper image disposal
|
|
114
|
+
|
|
115
|
+
6. **No Blocked UI**
|
|
116
|
+
- Never block main thread with image processing
|
|
117
|
+
- Always show progress indicator
|
|
118
|
+
- Allow cancellation
|
|
119
|
+
|
|
120
|
+
7. **No Copyright Violations**
|
|
121
|
+
- Never replicate copyrighted anime characters exactly
|
|
122
|
+
- Allow style transformation only
|
|
123
|
+
- Implement content moderation
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 🤖 AI Agent Directions
|
|
128
|
+
|
|
129
|
+
### For AI Code Generation Tools
|
|
130
|
+
|
|
131
|
+
When using this feature with AI code generation tools, follow these guidelines:
|
|
132
|
+
|
|
133
|
+
#### Prompt Template for AI Agents
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
You are implementing an anime selfie feature using @umituz/react-native-ai-generation-content.
|
|
137
|
+
|
|
138
|
+
REQUIREMENTS:
|
|
139
|
+
1. Import from: @umituz/react-native-ai-generation-content
|
|
140
|
+
2. Use the useAnimeSelfieFeature hook
|
|
141
|
+
3. Select anime style type
|
|
142
|
+
4. Implement image selection UI
|
|
143
|
+
5. Adjust intensity level (0.0 to 1.0)
|
|
144
|
+
6. Validate image before conversion
|
|
145
|
+
7. Show before/after comparison
|
|
146
|
+
8. Handle long processing times with progress
|
|
147
|
+
9. Implement proper error handling
|
|
148
|
+
10. Implement cleanup on unmount
|
|
149
|
+
|
|
150
|
+
CRITICAL RULES:
|
|
151
|
+
- MUST validate image before calling convert()
|
|
152
|
+
- MUST show before/after comparison
|
|
153
|
+
- MUST handle intensity adjustment
|
|
154
|
+
- MUST preserve facial features when enabled
|
|
155
|
+
- MUST implement debouncing (300ms)
|
|
156
|
+
- MUST allow style regeneration
|
|
157
|
+
|
|
158
|
+
CONFIGURATION:
|
|
159
|
+
- Provide valid userId (string)
|
|
160
|
+
- Set style: 'shonen' | 'shojo' | 'chibi' | 'realistic'
|
|
161
|
+
- Set intensity: 0.0 to 1.0 (default: 0.8)
|
|
162
|
+
- Implement onSelectPhoto callback
|
|
163
|
+
- Implement onSaveResult callback
|
|
164
|
+
- Configure callbacks: onProcessingStart, onProcessingComplete, onError
|
|
165
|
+
|
|
166
|
+
OPTIONS:
|
|
167
|
+
- style: Select anime style type
|
|
168
|
+
- intensity: 0.0 (subtle) to 1.0 (full transformation)
|
|
169
|
+
- preserveFaces: boolean (maintain facial features)
|
|
170
|
+
|
|
171
|
+
STRICTLY FORBIDDEN:
|
|
172
|
+
- No missing image validation
|
|
173
|
+
- No auto-processing without user action
|
|
174
|
+
- No hardcoded API keys
|
|
175
|
+
- No unhandled errors
|
|
176
|
+
- No memory leaks
|
|
177
|
+
- No blocking UI
|
|
178
|
+
- No copyright violations
|
|
179
|
+
|
|
180
|
+
QUALITY CHECKLIST:
|
|
181
|
+
- [ ] Image selection implemented
|
|
182
|
+
- [ ] Style selector added
|
|
183
|
+
- [ ] Intensity slider included
|
|
184
|
+
- [ ] Before/after comparison view
|
|
185
|
+
- [ ] Progress indicator during processing
|
|
186
|
+
- [ ] Error display with retry option
|
|
187
|
+
- [ ] Download/share functionality
|
|
188
|
+
- [ ] Style regeneration option
|
|
121
189
|
```
|
|
122
190
|
|
|
123
|
-
|
|
191
|
+
#### AI Implementation Checklist
|
|
192
|
+
|
|
193
|
+
Use this checklist when generating code:
|
|
194
|
+
|
|
195
|
+
- [ ] Feature imported from correct path
|
|
196
|
+
- [ ] Image selection implemented
|
|
197
|
+
- [ ] Style selector added
|
|
198
|
+
- [ ] Intensity control implemented
|
|
199
|
+
- [ ] Validation before convert()
|
|
200
|
+
- [ ] Before/after comparison view
|
|
201
|
+
- [ ] Progress indicator during processing
|
|
202
|
+
- [ ] Error display with user-friendly message
|
|
203
|
+
- [ ] Download/share buttons
|
|
204
|
+
- [ ] Style regeneration option
|
|
205
|
+
- [ ] Cleanup on unmount
|
|
206
|
+
- [ ] Original image preserved
|
|
207
|
+
|
|
208
|
+
---
|
|
124
209
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
210
|
+
## 🛠️ Configuration Strategy
|
|
211
|
+
|
|
212
|
+
### Essential Configuration
|
|
213
|
+
|
|
214
|
+
```typescript
|
|
215
|
+
// Required fields
|
|
216
|
+
{
|
|
217
|
+
userId: string
|
|
218
|
+
style: 'shonen' | 'shojo' | 'chibi' | 'realistic'
|
|
219
|
+
intensity: number // 0.0 to 1.0
|
|
220
|
+
onSelectPhoto: () => Promise<string | null>
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Optional callbacks
|
|
224
|
+
{
|
|
225
|
+
onProcessingStart?: () => void
|
|
226
|
+
onProcessingComplete?: (result) => void
|
|
227
|
+
onError?: (error: string) => void
|
|
131
228
|
}
|
|
132
229
|
```
|
|
133
230
|
|
|
134
|
-
|
|
231
|
+
### Recommended Settings
|
|
135
232
|
|
|
136
|
-
|
|
233
|
+
1. **Anime Styles**
|
|
234
|
+
- Shonen: Action-oriented, bold lines
|
|
235
|
+
- Shojo: Elegant, detailed features
|
|
236
|
+
- Chibi: Cute, exaggerated proportions
|
|
237
|
+
- Realistic: Anime-style but realistic proportions
|
|
137
238
|
|
|
138
|
-
|
|
239
|
+
2. **Intensity Levels**
|
|
240
|
+
- 0.3-0.5: Subtle anime influence
|
|
241
|
+
- 0.6-0.8: Balanced transformation (recommended)
|
|
242
|
+
- 0.9-1.0: Full anime style
|
|
139
243
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
```
|
|
244
|
+
3. **Image Quality**
|
|
245
|
+
- Minimum: 512x512 resolution
|
|
246
|
+
- Recommended: 1024x1024 or higher
|
|
247
|
+
- Format: JPEG or PNG
|
|
248
|
+
- Max size: 10MB
|
|
146
249
|
|
|
147
|
-
|
|
250
|
+
---
|
|
148
251
|
|
|
149
|
-
|
|
252
|
+
## 📊 State Management
|
|
150
253
|
|
|
151
|
-
|
|
152
|
-
const result = await feature.process({
|
|
153
|
-
style: 'shojo',
|
|
154
|
-
intensity: 0.8,
|
|
155
|
-
});
|
|
156
|
-
```
|
|
254
|
+
### Feature States
|
|
157
255
|
|
|
158
|
-
|
|
256
|
+
**isReady**: boolean
|
|
257
|
+
- Photo selected and validated
|
|
258
|
+
- Check before enabling convert button
|
|
159
259
|
|
|
160
|
-
|
|
260
|
+
**isProcessing**: boolean
|
|
261
|
+
- Anime conversion in progress
|
|
262
|
+
- Show loading/progress indicator
|
|
263
|
+
- Disable convert button
|
|
161
264
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
intensity: 1.0,
|
|
166
|
-
});
|
|
167
|
-
```
|
|
265
|
+
**progress**: number (0-100)
|
|
266
|
+
- Conversion progress percentage
|
|
267
|
+
- Update progress bar
|
|
168
268
|
|
|
169
|
-
|
|
269
|
+
**error**: string | null
|
|
270
|
+
- Error message if conversion failed
|
|
271
|
+
- Display to user with clear message
|
|
170
272
|
|
|
171
|
-
|
|
273
|
+
**result**: {
|
|
274
|
+
imageUrl: string
|
|
275
|
+
originalImageUrl?: string
|
|
276
|
+
style?: string
|
|
277
|
+
intensity?: number
|
|
278
|
+
metadata?: any
|
|
279
|
+
}
|
|
172
280
|
|
|
173
|
-
|
|
174
|
-
const result = await feature.process({
|
|
175
|
-
style: 'realistic',
|
|
176
|
-
intensity: 0.7,
|
|
177
|
-
});
|
|
178
|
-
```
|
|
281
|
+
---
|
|
179
282
|
|
|
180
|
-
##
|
|
283
|
+
## 🎨 Best Practices
|
|
181
284
|
|
|
182
|
-
|
|
183
|
-
2. Choose **Anime Style** - Select the desired anime style
|
|
184
|
-
3. Adjust **Intensity** - Control how strong the effect is
|
|
185
|
-
4. Tap **Convert** - Start the conversion
|
|
186
|
-
5. View **Result** - See the anime version
|
|
187
|
-
6. Save or Share - Save or share the result
|
|
285
|
+
### Photo Selection
|
|
188
286
|
|
|
189
|
-
|
|
287
|
+
1. **Image Quality**
|
|
288
|
+
- Good: Clear, well-lit photos
|
|
289
|
+
- Bad: Blurry, dark images
|
|
190
290
|
|
|
191
|
-
|
|
291
|
+
2. **Subject Clarity**
|
|
292
|
+
- Good: Clear facial features visible
|
|
293
|
+
- Bad: Occluded or distant faces
|
|
192
294
|
|
|
193
|
-
|
|
194
|
-
|
|
295
|
+
3. **Style Matching**
|
|
296
|
+
- Match style to photo content
|
|
297
|
+
- Consider gender and age for style
|
|
195
298
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
{ id: 'chibi', name: 'Chibi', preview: '...' },
|
|
200
|
-
{ id: 'realistic', name: 'Realistic', preview: '...' },
|
|
201
|
-
];
|
|
299
|
+
4. **Intensity**
|
|
300
|
+
- Start with moderate intensity (0.7-0.8)
|
|
301
|
+
- Adjust based on results
|
|
202
302
|
|
|
203
|
-
|
|
204
|
-
styles={animeStyles}
|
|
205
|
-
selectedStyle={selectedStyle}
|
|
206
|
-
onSelectStyle={setSelectedStyle}
|
|
207
|
-
/>
|
|
208
|
-
```
|
|
303
|
+
### User Experience
|
|
209
304
|
|
|
210
|
-
|
|
305
|
+
1. **Before/After Comparison**
|
|
306
|
+
- Side-by-side comparison
|
|
307
|
+
- Slider or toggle for easy comparison
|
|
308
|
+
- Zoom capability for detail inspection
|
|
211
309
|
|
|
212
|
-
|
|
213
|
-
|
|
310
|
+
2. **Style Preview**
|
|
311
|
+
- Show examples of each style
|
|
312
|
+
- Preview style before conversion
|
|
313
|
+
- Explain style characteristics
|
|
214
314
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
value={intensity}
|
|
220
|
-
onValueChange={setIntensity}
|
|
221
|
-
/>
|
|
315
|
+
3. **Progress Feedback**
|
|
316
|
+
- Show estimated time remaining
|
|
317
|
+
- Update progress regularly
|
|
318
|
+
- Allow cancellation
|
|
222
319
|
|
|
223
|
-
|
|
224
|
-
```
|
|
320
|
+
---
|
|
225
321
|
|
|
226
|
-
|
|
322
|
+
## 🐛 Common Pitfalls
|
|
227
323
|
|
|
228
|
-
|
|
229
|
-
import { ResultDisplay } from '@umituz/react-native-ai-generation-content';
|
|
324
|
+
### Quality Issues
|
|
230
325
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
originalImage={photo}
|
|
234
|
-
resultImage={feature.state.result.imageUrl}
|
|
235
|
-
onSave={() => feature.saveResult()}
|
|
236
|
-
onShare={() => shareImage(feature.state.result.imageUrl)}
|
|
237
|
-
/>
|
|
238
|
-
)}
|
|
239
|
-
```
|
|
326
|
+
❌ **Problem**: Poor anime conversion
|
|
327
|
+
✅ **Solution**: Use higher quality photos, try different style or intensity
|
|
240
328
|
|
|
241
|
-
|
|
329
|
+
### Style Issues
|
|
242
330
|
|
|
243
|
-
|
|
331
|
+
❌ **Problem**: Anime style doesn't match photo
|
|
332
|
+
✅ **Solution**: Try different style, adjust intensity
|
|
244
333
|
|
|
245
|
-
|
|
246
|
-
const result = await feature.process({
|
|
247
|
-
style: 'shonen',
|
|
248
|
-
intensity: 0.85,
|
|
249
|
-
enhanceDetails: true,
|
|
250
|
-
backgroundStyle: 'anime',
|
|
251
|
-
});
|
|
252
|
-
```
|
|
334
|
+
### Performance Issues
|
|
253
335
|
|
|
254
|
-
|
|
336
|
+
❌ **Problem**: Slow conversion
|
|
337
|
+
✅ **Solution**: Compress images, show progress, allow cancellation
|
|
255
338
|
|
|
256
|
-
|
|
257
|
-
// Convert multiple photos
|
|
258
|
-
const photos = ['photo1.jpg', 'photo2.jpg', 'photo3.jpg'];
|
|
259
|
-
const results = await Promise.all(
|
|
260
|
-
photos.map(photo => feature.process({ image: photo }))
|
|
261
|
-
);
|
|
262
|
-
```
|
|
339
|
+
### Memory Issues
|
|
263
340
|
|
|
264
|
-
|
|
341
|
+
❌ **Problem**: App crashes with large images
|
|
342
|
+
✅ **Solution**: Compress images, clean up properly, optimize memory
|
|
265
343
|
|
|
266
|
-
|
|
267
|
-
2. **Good Lighting**: Even lighting produces better results
|
|
268
|
-
3. **Clear Faces**: Ensure facial features are clearly visible
|
|
269
|
-
4. **Intensity**: Start with 0.7-0.8 for natural results
|
|
270
|
-
5. **Style Selection**: Match style to photo subject and mood
|
|
344
|
+
---
|
|
271
345
|
|
|
272
|
-
##
|
|
346
|
+
## 📦 Related Components
|
|
273
347
|
|
|
274
|
-
|
|
348
|
+
Use these components from the library:
|
|
275
349
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
});
|
|
282
|
-
```
|
|
350
|
+
- **PhotoUploadCard**: Upload photo interface
|
|
351
|
+
- **ResultDisplay**: Before/after comparison
|
|
352
|
+
- **StyleSelector**: Choose anime style
|
|
353
|
+
- **IntensitySlider**: Adjust intensity
|
|
354
|
+
- **ProgressBar**: Progress display
|
|
283
355
|
|
|
284
|
-
|
|
356
|
+
Located at: `src/presentation/components/`
|
|
285
357
|
|
|
286
|
-
|
|
287
|
-
// Generate anime content for social media
|
|
288
|
-
const result = await feature.process({
|
|
289
|
-
style: 'chibi',
|
|
290
|
-
intensity: 1.0,
|
|
291
|
-
});
|
|
292
|
-
```
|
|
358
|
+
---
|
|
293
359
|
|
|
294
|
-
|
|
360
|
+
## 🔄 Migration Strategy
|
|
295
361
|
|
|
296
|
-
|
|
297
|
-
// Create anime art from photos
|
|
298
|
-
const result = await feature.process({
|
|
299
|
-
style: 'realistic',
|
|
300
|
-
intensity: 0.7,
|
|
301
|
-
enhanceDetails: true,
|
|
302
|
-
});
|
|
303
|
-
```
|
|
362
|
+
If migrating from previous implementation:
|
|
304
363
|
|
|
305
|
-
|
|
364
|
+
1. **Update imports** to new path
|
|
365
|
+
2. **Add style selector**
|
|
366
|
+
3. **Implement intensity control**
|
|
367
|
+
4. **Update state handling** for new structure
|
|
368
|
+
5. **Add before/after comparison**
|
|
369
|
+
6. **Test all anime styles**
|
|
306
370
|
|
|
307
|
-
|
|
308
|
-
const { state, process } = useAnimeSelfieFeature({ ...config });
|
|
371
|
+
---
|
|
309
372
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
373
|
+
## 📚 Additional Resources
|
|
374
|
+
|
|
375
|
+
- Main documentation: `/docs/`
|
|
376
|
+
- API reference: `/docs/api/`
|
|
377
|
+
- Examples: `/docs/examples/basic/anime-selfie/`
|
|
378
|
+
- Architecture: `/ARCHITECTURE.md`
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
**Last Updated**: 2025-01-08
|
|
383
|
+
**Version**: 2.0.0 (Strategy-based Documentation)
|
|
316
384
|
|
|
317
|
-
|
|
385
|
+
---
|
|
318
386
|
|
|
319
|
-
|
|
320
|
-
- [Face Swap](../face-swap) - Swap faces between images
|
|
321
|
-
- [Text to Image](../text-to-image) - Generate anime from text prompts
|
|
387
|
+
## 📝 Changelog
|
|
322
388
|
|
|
323
|
-
|
|
389
|
+
### v2.0.0 - 2025-01-08
|
|
390
|
+
- **BREAKING**: Documentation format changed to strategy-based
|
|
391
|
+
- Removed extensive code examples
|
|
392
|
+
- Added rules, prohibitions, and AI agent directions
|
|
393
|
+
- Focus on best practices and implementation guidance
|
|
324
394
|
|
|
325
|
-
|
|
395
|
+
### v1.0.0 - Initial Release
|
|
396
|
+
- Initial feature documentation
|