@umituz/react-native-ai-generation-content 1.17.229 → 1.17.230

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.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +346 -0
  3. package/package.json +1 -3
  4. package/src/domain/README.md +503 -0
  5. package/src/domains/content-moderation/README.md +363 -0
  6. package/src/domains/creations/README.md +394 -0
  7. package/src/domains/face-detection/README.md +395 -0
  8. package/src/domains/prompts/README.md +387 -0
  9. package/src/features/ai-hug/README.md +276 -0
  10. package/src/features/ai-kiss/README.md +276 -0
  11. package/src/features/anime-selfie/README.md +325 -0
  12. package/src/features/audio-generation/README.md +370 -0
  13. package/src/features/colorization/README.md +289 -0
  14. package/src/features/couple-future/README.md +270 -0
  15. package/src/features/face-swap/README.md +234 -0
  16. package/src/features/future-prediction/README.md +281 -0
  17. package/src/features/hd-touch-up/README.md +309 -0
  18. package/src/features/image-captioning/README.md +361 -0
  19. package/src/features/image-to-image/README.md +418 -0
  20. package/src/features/image-to-video/README.md +369 -0
  21. package/src/features/inpainting/README.md +302 -0
  22. package/src/features/meme-generator/README.md +327 -0
  23. package/src/features/photo-restoration/README.md +286 -0
  24. package/src/features/remove-background/README.md +292 -0
  25. package/src/features/remove-object/README.md +352 -0
  26. package/src/features/replace-background/README.md +288 -0
  27. package/src/features/script-generator/README.md +362 -0
  28. package/src/features/shared/README.md +280 -0
  29. package/src/features/sketch-to-image/README.md +296 -0
  30. package/src/features/style-transfer/README.md +301 -0
  31. package/src/features/text-to-image/README.md +228 -0
  32. package/src/features/text-to-video/README.md +245 -0
  33. package/src/features/text-to-voice/README.md +335 -0
  34. package/src/features/upscaling/README.md +247 -0
  35. package/src/infrastructure/config/README.md +310 -0
  36. package/src/infrastructure/middleware/README.md +378 -0
  37. package/src/infrastructure/orchestration/README.md +362 -0
  38. package/src/infrastructure/services/README.md +382 -0
  39. package/src/infrastructure/utils/README.md +523 -0
  40. package/src/infrastructure/wrappers/README.md +336 -0
  41. package/src/presentation/components/README.md +535 -0
  42. package/src/presentation/hooks/README.md +380 -0
  43. package/src/presentation/layouts/README.md +374 -0
  44. package/src/presentation/screens/README.md +430 -0
  45. package/src/presentation/layouts/types/.npmignore.tmp +0 -0
@@ -0,0 +1,270 @@
1
+ # Couple Future
2
+
3
+ Generate images showing couples in future scenarios using AI.
4
+
5
+ ## Features
6
+
7
+ - Create future predictions for couples
8
+ - Multiple future scenarios (wedding, old age, etc.)
9
+ - Natural aging and progression
10
+ - High-quality facial matching
11
+ - Romantic and heartwarming results
12
+
13
+ ## Installation
14
+
15
+ This feature is part of `@umituz/react-native-ai-generation-content`.
16
+
17
+ ```bash
18
+ npm install @umituz/react-native-ai-generation-content
19
+ ```
20
+
21
+ ## Basic Usage
22
+
23
+ ### Using the Hook
24
+
25
+ ```tsx
26
+ import { useCoupleFutureGeneration } from '@umituz/react-native-ai-generation-content';
27
+ import * as ImagePicker from 'react-native-image-picker';
28
+
29
+ function CoupleFutureScreen() {
30
+ const [person1, setPerson1] = useState<string | null>(null);
31
+ const [person2, setPerson2] = useState<string | null>(null);
32
+
33
+ const feature = useCoupleFutureGeneration({
34
+ config: {
35
+ scenario: 'wedding',
36
+ onProcessingStart: () => console.log('Generating future image...'),
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
+ <ScenarioSelector
75
+ selectedScenario={feature.state.scenario}
76
+ onSelectScenario={feature.setScenario}
77
+ />
78
+
79
+ <Button
80
+ title="Generate Future Image"
81
+ onPress={feature.process}
82
+ disabled={!feature.isReady || feature.state.isProcessing}
83
+ />
84
+
85
+ {feature.state.isProcessing && (
86
+ <View>
87
+ <Text>Creating your future 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
+ ```
99
+
100
+ ### Using the Unified AI Feature Screen
101
+
102
+ ```tsx
103
+ import { AIFeatureScreen } from '@umituz/react-native-ai-generation-content';
104
+
105
+ function App() {
106
+ return (
107
+ <AIFeatureScreen
108
+ featureId="couple-future"
109
+ userId="user-123"
110
+ />
111
+ );
112
+ }
113
+ ```
114
+
115
+ ## Configuration Options
116
+
117
+ ### Feature Config
118
+
119
+ ```tsx
120
+ interface CoupleFutureFeatureConfig {
121
+ scenario?: 'wedding' | 'old-age' | 'anniversary' | 'family';
122
+ onProcessingStart?: () => void;
123
+ onProcessingComplete?: (result: CoupleFutureResult) => void;
124
+ onError?: (error: string) => void;
125
+ }
126
+ ```
127
+
128
+ ### Generation Options
129
+
130
+ ```tsx
131
+ interface CoupleFutureOptions {
132
+ scenario: 'wedding' | 'old-age' | 'anniversary' | 'family';
133
+ preserveFaces?: boolean; // Maintain facial features (default: true)
134
+ enhanceQuality?: boolean; // Enhance output quality (default: true)
135
+ }
136
+ ```
137
+
138
+ ## Future Scenarios
139
+
140
+ ### Wedding
141
+
142
+ Couples on their wedding day:
143
+
144
+ ```tsx
145
+ const result = await feature.process({
146
+ scenario: 'wedding',
147
+ });
148
+ ```
149
+
150
+ ### Old Age
151
+
152
+ The couple as elderly:
153
+
154
+ ```tsx
155
+ const result = await feature.process({
156
+ scenario: 'old-age',
157
+ });
158
+ ```
159
+
160
+ ### Anniversary
161
+
162
+ Celebrating an anniversary:
163
+
164
+ ```tsx
165
+ const result = await feature.process({
166
+ scenario: 'anniversary',
167
+ });
168
+ ```
169
+
170
+ ### Family
171
+
172
+ The couple with a family:
173
+
174
+ ```tsx
175
+ const result = await feature.process({
176
+ scenario: 'family',
177
+ });
178
+ ```
179
+
180
+ ## Usage Flow
181
+
182
+ 1. Select **Person 1** - Choose the first person's photo
183
+ 2. Select **Person 2** - Choose the second person's photo
184
+ 3. Choose **Scenario** - Select the future scenario
185
+ 4. Tap **Generate** - Start the AI generation
186
+ 5. View Result - See the future prediction
187
+ 6. Save or Share - Save to gallery or share
188
+
189
+ ## Component Examples
190
+
191
+ ### Scenario Selector
192
+
193
+ ```tsx
194
+ import { StylePresetsGrid } from '@umituz/react-native-ai-generation-content';
195
+
196
+ const scenarios = [
197
+ { id: 'wedding', name: 'Wedding', preview: '...' },
198
+ { id: 'old-age', name: 'Old Age', preview: '...' },
199
+ { id: 'anniversary', name: 'Anniversary', preview: '...' },
200
+ { id: 'family', name: 'Family', preview: '...' },
201
+ ];
202
+
203
+ <StylePresetsGrid
204
+ styles={scenarios}
205
+ selectedStyle={selectedScenario}
206
+ onSelectStyle={setSelectedScenario}
207
+ />
208
+ ```
209
+
210
+ ### Result Display with Actions
211
+
212
+ ```tsx
213
+ import { ResultImageCard } from '@umituz/react-native-ai-generation-content';
214
+
215
+ {feature.state.result && (
216
+ <ResultImageCard
217
+ imageUrl={feature.state.result.imageUrl}
218
+ onSave={() => feature.saveResult()}
219
+ onShare={() => shareImage(feature.state.result.imageUrl)}
220
+ onRegenerate={() => feature.process()}
221
+ />
222
+ )}
223
+ ```
224
+
225
+ ## Best Practices
226
+
227
+ 1. **Photo Quality**: Use high-quality, well-lit photos
228
+ 2. **Face Visibility**: Ensure both faces are clearly visible
229
+ 3. **Forward Facing**: Forward-facing photos work best
230
+ 4. **Similar Angles**: Similar head angles produce better results
231
+ 5. **Good Lighting**: Even lighting creates more natural results
232
+
233
+ ## Use Cases
234
+
235
+ ### Fun with Partners
236
+
237
+ ```tsx
238
+ // Create fun future predictions with your partner
239
+ const result = await feature.process({
240
+ scenario: 'wedding',
241
+ });
242
+ ```
243
+
244
+ ### Social Media Content
245
+
246
+ ```tsx
247
+ // Share couple future predictions on social media
248
+ const result = await feature.process({
249
+ scenario: 'old-age',
250
+ });
251
+ ```
252
+
253
+ ### Anniversary Gifts
254
+
255
+ ```tsx
256
+ // Create anniversary content
257
+ const result = await feature.process({
258
+ scenario: 'anniversary',
259
+ });
260
+ ```
261
+
262
+ ## Related Features
263
+
264
+ - [AI Hug](../ai-hug) - Generate AI hug images
265
+ - [AI Kiss](../ai-kiss) - Generate AI kiss images
266
+ - [Face Swap](../face-swap) - Swap faces between images
267
+
268
+ ## License
269
+
270
+ MIT
@@ -0,0 +1,234 @@
1
+ # Face Swap
2
+
3
+ Swap faces between people in images using AI.
4
+
5
+ ## Features
6
+
7
+ - Swap faces between two images
8
+ - Automatic face detection and alignment
9
+ - Support for multiple faces in one image
10
+ - High-quality output with natural results
11
+
12
+ ## Installation
13
+
14
+ This feature is part of `@umituz/react-native-ai-generation-content`.
15
+
16
+ ```bash
17
+ npm install @umituz/react-native-ai-generation-content
18
+ ```
19
+
20
+ ## Basic Usage
21
+
22
+ ### Using the Hook
23
+
24
+ ```tsx
25
+ import { useFaceSwapFeature } from '@umituz/react-native-ai-generation-content';
26
+ import * as ImagePicker from 'react-native-image-picker';
27
+
28
+ function FaceSwapScreen() {
29
+ const [sourceImage, setSourceImage] = useState<string | null>(null);
30
+ const [targetImage, setTargetImage] = useState<string | null>(null);
31
+
32
+ const feature = useFaceSwapFeature({
33
+ config: {
34
+ onProcessingStart: () => console.log('Starting face swap...'),
35
+ onProcessingComplete: (result) => console.log('Complete:', result),
36
+ onError: (error) => console.error('Error:', error),
37
+ },
38
+ onSelectSourceImage: async () => {
39
+ const result = await ImagePicker.launchImageLibrary({ mediaType: 'photo' });
40
+ if (result.assets && result.assets[0].uri) {
41
+ const base64 = await convertToBase64(result.assets[0].uri);
42
+ setSourceImage(base64);
43
+ return base64;
44
+ }
45
+ return null;
46
+ },
47
+ onSelectTargetImage: async () => {
48
+ const result = await ImagePicker.launchImageLibrary({ mediaType: 'photo' });
49
+ if (result.assets && result.assets[0].uri) {
50
+ const base64 = await convertToBase64(result.assets[0].uri);
51
+ setTargetImage(base64);
52
+ return base64;
53
+ }
54
+ return null;
55
+ },
56
+ onSaveImage: async (imageUrl) => {
57
+ // Save to gallery or download
58
+ await saveToGallery(imageUrl);
59
+ },
60
+ });
61
+
62
+ return (
63
+ <View>
64
+ <DualImagePicker
65
+ sourceImage={sourceImage}
66
+ targetImage={targetImage}
67
+ onSelectSourceImage={feature.selectSourceImage}
68
+ onSelectTargetImage={feature.selectTargetImage}
69
+ />
70
+
71
+ <Button
72
+ title="Swap Faces"
73
+ onPress={feature.process}
74
+ disabled={!feature.isReady || feature.state.isProcessing}
75
+ />
76
+
77
+ {feature.state.isProcessing && (
78
+ <ActivityIndicator />
79
+ )}
80
+
81
+ {feature.state.result && (
82
+ <Image source={{ uri: feature.state.result.imageUrl }} />
83
+ )}
84
+ </View>
85
+ );
86
+ }
87
+ ```
88
+
89
+ ### Using the Unified AI Feature Screen
90
+
91
+ ```tsx
92
+ import { AIFeatureScreen } from '@umituz/react-native-ai-generation-content';
93
+
94
+ function App() {
95
+ return (
96
+ <AIFeatureScreen
97
+ featureId="face-swap"
98
+ userId="user-123"
99
+ />
100
+ );
101
+ }
102
+ ```
103
+
104
+ ## Configuration Options
105
+
106
+ ### Feature Config
107
+
108
+ ```tsx
109
+ interface FaceSwapFeatureConfig {
110
+ defaultOptions?: {
111
+ enhanceFace?: boolean; // Enhance face quality (default: true)
112
+ matchSkinTone?: boolean; // Match skin tones (default: true)
113
+ };
114
+ onProcessingStart?: () => void;
115
+ onProcessingComplete?: (result: FaceSwapResult) => void;
116
+ onError?: (error: string) => void;
117
+ }
118
+ ```
119
+
120
+ ## Usage Flow
121
+
122
+ 1. Select **Source Image** - Image containing the face to swap FROM
123
+ 2. Select **Target Image** - Image containing the face to swap TO
124
+ 3. Tap **Swap Faces** - Start the face swap process
125
+ 4. View Result - See the face-swapped image
126
+ 5. Save or Share - Save to gallery or share with others
127
+
128
+ ## Component Examples
129
+
130
+ ### Using DualImagePicker
131
+
132
+ ```tsx
133
+ import { DualImagePicker } from '@umituz/react-native-ai-generation-content';
134
+
135
+ <DualImagePicker
136
+ sourceImage={sourceImage}
137
+ targetImage={targetImage}
138
+ onSelectSourceImage={handleSelectSource}
139
+ onSelectTargetImage={handleSelectTarget}
140
+ sourceLabel="Face to Use"
141
+ targetLabel="Face to Replace"
142
+ />
143
+ ```
144
+
145
+ ### Custom Result Display
146
+
147
+ ```tsx
148
+ import { ResultImageCard } from '@umituz/react-native-ai-generation-content';
149
+
150
+ {feature.state.result && (
151
+ <ResultImageCard
152
+ imageUrl={feature.state.result.imageUrl}
153
+ onSave={() => feature.saveResult()}
154
+ onShare={() => shareImage(feature.state.result.imageUrl)}
155
+ />
156
+ )}
157
+ ```
158
+
159
+ ## Advanced Usage
160
+
161
+ ### Custom Options
162
+
163
+ ```tsx
164
+ const feature = useFaceSwapFeature({
165
+ config: {
166
+ defaultOptions: {
167
+ enhanceFace: true,
168
+ matchSkinTone: true,
169
+ },
170
+ },
171
+ // ... other props
172
+ });
173
+ ```
174
+
175
+ ### Before Process Hook
176
+
177
+ ```tsx
178
+ const feature = useFaceSwapFeature({
179
+ config: { ... },
180
+ onBeforeProcess: async () => {
181
+ // Show confirmation dialog
182
+ return new Promise((resolve) => {
183
+ Alert.alert(
184
+ 'Confirm Face Swap',
185
+ 'Do you want to proceed with face swap?',
186
+ [
187
+ { text: 'Cancel', onPress: () => resolve(false) },
188
+ { text: 'OK', onPress: () => resolve(true) },
189
+ ]
190
+ );
191
+ });
192
+ },
193
+ // ... other props
194
+ });
195
+ ```
196
+
197
+ ## Best Practices
198
+
199
+ 1. **Image Quality**: Use high-quality images for better results
200
+ 2. **Face Visibility**: Ensure faces are clearly visible in both images
201
+ 3. **Frontal Faces**: Front-facing photos work best
202
+ 4. **Lighting**: Similar lighting conditions produce more natural results
203
+ 5. **Multiple Faces**: The feature can handle multiple faces in one image
204
+
205
+ ## Error Handling
206
+
207
+ ```tsx
208
+ const { state, process } = useFaceSwapFeature({ ...config });
209
+
210
+ useEffect(() => {
211
+ if (state.error) {
212
+ Alert.alert('Face Swap Failed', state.error);
213
+ }
214
+ }, [state.error]);
215
+ ```
216
+
217
+ ## Common Use Cases
218
+
219
+ - Fun face swaps between friends
220
+ - Historical face replacement
221
+ - Character face swaps
222
+ - Celebrity face swaps
223
+ - Movie character transformations
224
+
225
+ ## Related Features
226
+
227
+ - [AI Hug](../ai-hug) - Generate AI hug images
228
+ - [AI Kiss](../ai-kiss) - Generate AI kiss images
229
+ - [Photo Restoration](../photo-restoration) - Restore old photos
230
+ - [Anime Selfie](../anime-selfie) - Convert photos to anime style
231
+
232
+ ## License
233
+
234
+ MIT