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

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 (47) 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 +431 -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 +394 -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/components/result/ResultStoryCard.tsx +1 -6
  43. package/src/presentation/hooks/README.md +380 -0
  44. package/src/presentation/layouts/README.md +374 -0
  45. package/src/presentation/screens/README.md +430 -0
  46. package/src/presentation/types/result-config.types.ts +3 -3
  47. package/src/presentation/layouts/types/.npmignore.tmp +0 -0
@@ -0,0 +1,288 @@
1
+ # Replace Background
2
+
3
+ Replace image backgrounds with new scenes using AI.
4
+
5
+ ## Features
6
+
7
+ - Remove existing background
8
+ - Replace with custom backgrounds
9
+ - Built-in background templates
10
+ - Upload custom background images
11
+ - Natural edge blending
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 { useReplaceBackgroundFeature } from '@umituz/react-native-ai-generation-content';
27
+ import * as ImagePicker from 'react-native-image-picker';
28
+
29
+ function ReplaceBackgroundScreen() {
30
+ const [foreground, setForeground] = useState<string | null>(null);
31
+ const [background, setBackground] = useState<string | null>(null);
32
+
33
+ const feature = useReplaceBackgroundFeature({
34
+ config: {
35
+ edgeSmoothness: 'medium',
36
+ onProcessingStart: () => console.log('Replacing background...'),
37
+ onProcessingComplete: (result) => console.log('Complete:', result),
38
+ onError: (error) => console.error('Error:', error),
39
+ },
40
+ onSelectForeground: 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
+ setForeground(base64);
45
+ return base64;
46
+ }
47
+ return null;
48
+ },
49
+ onSelectBackground: 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
+ setBackground(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
+ <PhotoUploadCard
66
+ image={foreground}
67
+ onSelectImage={feature.selectForeground}
68
+ title="Select Foreground Image"
69
+ />
70
+
71
+ <PhotoUploadCard
72
+ image={background}
73
+ onSelectImage={feature.selectBackground}
74
+ title="Select New Background"
75
+ />
76
+
77
+ <Button
78
+ title="Replace Background"
79
+ onPress={feature.process}
80
+ disabled={!feature.isReady || feature.state.isProcessing}
81
+ />
82
+
83
+ {feature.state.isProcessing && (
84
+ <ActivityIndicator />
85
+ )}
86
+
87
+ {feature.state.result && (
88
+ <Image source={{ uri: feature.state.result.imageUrl }} />
89
+ )}
90
+ </View>
91
+ );
92
+ }
93
+ ```
94
+
95
+ ### Using the Unified AI Feature Screen
96
+
97
+ ```tsx
98
+ import { AIFeatureScreen } from '@umituz/react-native-ai-generation-content';
99
+
100
+ function App() {
101
+ return (
102
+ <AIFeatureScreen
103
+ featureId="replace-background"
104
+ userId="user-123"
105
+ />
106
+ );
107
+ }
108
+ ```
109
+
110
+ ## Configuration Options
111
+
112
+ ### Feature Config
113
+
114
+ ```tsx
115
+ interface ReplaceBackgroundFeatureConfig {
116
+ edgeSmoothness?: 'low' | 'medium' | 'high';
117
+ adjustLighting?: boolean; // Match lighting between images
118
+ onProcessingStart?: () => void;
119
+ onProcessingComplete?: (result: ReplaceBackgroundResult) => void;
120
+ onError?: (error: string) => void;
121
+ }
122
+ ```
123
+
124
+ ### Processing Options
125
+
126
+ ```tsx
127
+ interface ReplaceBackgroundOptions {
128
+ edgeSmoothness: 'low' | 'medium' | 'high';
129
+ adjustLighting?: boolean; // Match foreground and background lighting
130
+ adjustColors?: boolean; // Color-grade foreground to match background
131
+ blurBackground?: boolean; // Add blur to background for depth effect
132
+ }
133
+ ```
134
+
135
+ ## Usage Flow
136
+
137
+ 1. Select **Foreground** - Choose the main subject image
138
+ 2. Select **Background** - Choose new background image
139
+ 3. Configure **Options** - Adjust edge smoothness and other settings
140
+ 4. Tap **Replace** - Start the replacement process
141
+ 5. View **Result** - See the combined image
142
+ 6. Save or Share - Save or share the result
143
+
144
+ ## Component Examples
145
+
146
+ ### Background Templates
147
+
148
+ ```tsx
149
+ import { StylePresetsGrid } from '@umituz/react-native-ai-generation-content';
150
+
151
+ const backgrounds = [
152
+ { id: 'beach', name: 'Beach', preview: 'https://...' },
153
+ { id: 'city', name: 'City', preview: 'https://...' },
154
+ { id: 'nature', name: 'Nature', preview: 'https://...' },
155
+ { id: 'studio', name: 'Studio', preview: 'https://...' },
156
+ ];
157
+
158
+ <StylePresetsGrid
159
+ styles={backgrounds}
160
+ selectedStyle={selectedBackground}
161
+ onSelectStyle={async (bg) => {
162
+ const bgImage = await downloadBackground(bg.preview);
163
+ setBackground(bgImage);
164
+ }}
165
+ />
166
+ ```
167
+
168
+ ### Edge Smoothness Selector
169
+
170
+ ```tsx
171
+ import { GridSelector } from '@umituz/react-native-ai-generation-content';
172
+
173
+ const smoothnessOptions = [
174
+ { id: 'low', name: 'Sharp', description: 'Precise edges' },
175
+ { id: 'medium', name: 'Balanced', description: 'Natural edges' },
176
+ { id: 'high', name: 'Smooth', description: 'Soft edges' },
177
+ ];
178
+
179
+ <GridSelector
180
+ options={smoothnessOptions}
181
+ selectedOption={smoothness}
182
+ onSelectOption={setSmoothness}
183
+ />
184
+ ```
185
+
186
+ ### Lighting Toggle
187
+
188
+ ```tsx
189
+ import { Switch } from 'react-native';
190
+
191
+ <Switch
192
+ value={adjustLighting}
193
+ onValueChange={setAdjustLighting}
194
+ />
195
+
196
+ <Text>Match Lighting</Text>
197
+ ```
198
+
199
+ ## Advanced Usage
200
+
201
+ ### Custom Options
202
+
203
+ ```tsx
204
+ const result = await feature.process({
205
+ edgeSmoothness: 'medium',
206
+ adjustLighting: true,
207
+ adjustColors: true,
208
+ blurBackground: false,
209
+ });
210
+ ```
211
+
212
+ ### Preset Backgrounds
213
+
214
+ ```tsx
215
+ const PRESET_BACKGROUNDS = {
216
+ beach: 'https://example.com/bg/beach.jpg',
217
+ city: 'https://example.com/bg/city.jpg',
218
+ studio: 'https://example.com/bg/studio.jpg',
219
+ nature: 'https://example.com/bg/nature.jpg',
220
+ };
221
+
222
+ const result = await feature.process({
223
+ background: PRESET_BACKGROUNDS.beach,
224
+ edgeSmoothness: 'medium',
225
+ });
226
+ ```
227
+
228
+ ## Use Cases
229
+
230
+ ### Professional Photos
231
+
232
+ ```tsx
233
+ // Replace with professional studio background
234
+ const result = await feature.process({
235
+ background: studioBackground,
236
+ adjustLighting: true,
237
+ adjustColors: true,
238
+ });
239
+ ```
240
+
241
+ ### Travel Photos
242
+
243
+ ```tsx
244
+ // Add exotic travel backgrounds
245
+ const result = await feature.process({
246
+ background: beachBackground,
247
+ edgeSmoothness: 'high',
248
+ });
249
+ ```
250
+
251
+ ### Creative Effects
252
+
253
+ ```tsx
254
+ // Create fantasy backgrounds
255
+ const result = await feature.process({
256
+ background: fantasyBackground,
257
+ blurBackground: true,
258
+ });
259
+ ```
260
+
261
+ ### Product Photos
262
+
263
+ ```tsx
264
+ // Clean white background for products
265
+ const result = await feature.process({
266
+ background: whiteBackground,
267
+ edgeSmoothness: 'low',
268
+ adjustLighting: true,
269
+ });
270
+ ```
271
+
272
+ ## Best Practices
273
+
274
+ 1. **Foreground Quality**: Use high-quality images with clear subjects
275
+ 2. **Background Match**: Choose backgrounds with similar perspective
276
+ 3. **Edge Smoothness**: Higher values for portraits, lower for products
277
+ 4. **Lighting**: Enable lighting adjustment for more natural results
278
+ 5. **Colors**: Use color adjustment for better foreground/background harmony
279
+
280
+ ## Related Features
281
+
282
+ - [Remove Background](../remove-background) - Remove backgrounds
283
+ - [Remove Object](../remove-object) - Remove unwanted objects
284
+ - [Image to Image](../image-to-image) - Transform images with AI
285
+
286
+ ## License
287
+
288
+ MIT
@@ -0,0 +1,362 @@
1
+ # Script Generator
2
+
3
+ Generate scripts for videos, podcasts, and content using AI.
4
+
5
+ ## Features
6
+
7
+ - Generate video scripts
8
+ - Podcast script templates
9
+ - Social media content scripts
10
+ - Customizable script formats
11
+ - Multiple tone and style options
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 { useScriptGenerator } from '@umituz/react-native-ai-generation-content';
27
+
28
+ function ScriptGeneratorScreen() {
29
+ const [prompt, setPrompt] = useState('');
30
+
31
+ const feature = useScriptGenerator({
32
+ config: {
33
+ scriptType: 'video',
34
+ tone: 'casual',
35
+ duration: 60, // seconds
36
+ onProcessingStart: () => console.log('Generating script...'),
37
+ onProcessingComplete: (result) => console.log('Complete:', result),
38
+ onError: (error) => console.error('Error:', error),
39
+ },
40
+ });
41
+
42
+ return (
43
+ <View>
44
+ <TextInput
45
+ placeholder="What's your script about?"
46
+ value={prompt}
47
+ onChangeText={setPrompt}
48
+ multiline
49
+ numberOfLines={4}
50
+ />
51
+
52
+ <ScriptTypeSelector
53
+ selectedType={feature.state.scriptType}
54
+ onSelectType={feature.setScriptType}
55
+ />
56
+
57
+ <ToneSelector
58
+ selectedTone={feature.state.tone}
59
+ onSelectTone={feature.setTone}
60
+ />
61
+
62
+ <DurationInput
63
+ value={feature.state.duration}
64
+ onChange={feature.setDuration}
65
+ />
66
+
67
+ <Button
68
+ title="Generate Script"
69
+ onPress={() => feature.generate(prompt)}
70
+ disabled={!prompt || feature.state.isProcessing}
71
+ />
72
+
73
+ {feature.state.isProcessing && (
74
+ <ActivityIndicator />
75
+ )}
76
+
77
+ {feature.state.result && (
78
+ <ScriptDisplay
79
+ script={feature.state.result.script}
80
+ onSave={() => saveScript(feature.state.result.script)}
81
+ onShare={() => shareScript(feature.state.result.script)}
82
+ />
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="script-generator"
98
+ userId="user-123"
99
+ />
100
+ );
101
+ }
102
+ ```
103
+
104
+ ## Configuration Options
105
+
106
+ ### Feature Config
107
+
108
+ ```tsx
109
+ interface ScriptGeneratorFeatureConfig {
110
+ scriptType?: 'video' | 'podcast' | 'social' | 'presentation';
111
+ tone?: 'casual' | 'professional' | 'humorous' | 'dramatic';
112
+ duration?: number; // Target duration in seconds
113
+ language?: string; // Script language (default: 'en')
114
+ onProcessingStart?: () => void;
115
+ onProcessingComplete?: (result: ScriptGeneratorResult) => void;
116
+ onError?: (error: string) => void;
117
+ }
118
+ ```
119
+
120
+ ### Generation Options
121
+
122
+ ```tsx
123
+ interface ScriptGeneratorOptions {
124
+ scriptType: 'video' | 'podcast' | 'social' | 'presentation';
125
+ tone: 'casual' | 'professional' | 'humorous' | 'dramatic';
126
+ duration: number; // Target duration in seconds
127
+ includeVisuals?: boolean; // Include visual cues (default: true for video)
128
+ includeNotes?: boolean; // Include production notes (default: false)
129
+ }
130
+ ```
131
+
132
+ ## Script Types
133
+
134
+ ### Video Script
135
+
136
+ Scripts for videos with visual cues:
137
+
138
+ ```tsx
139
+ const result = await feature.generate(prompt, {
140
+ scriptType: 'video',
141
+ tone: 'casual',
142
+ duration: 120,
143
+ includeVisuals: true,
144
+ });
145
+ ```
146
+
147
+ ### Podcast Script
148
+
149
+ Conversational scripts for podcasts:
150
+
151
+ ```tsx
152
+ const result = await feature.generate(prompt, {
153
+ scriptType: 'podcast',
154
+ tone: 'casual',
155
+ duration: 1800, // 30 minutes
156
+ });
157
+ ```
158
+
159
+ ### Social Media Script
160
+
161
+ Short scripts for social platforms:
162
+
163
+ ```tsx
164
+ const result = await feature.generate(prompt, {
165
+ scriptType: 'social',
166
+ tone: 'casual',
167
+ duration: 60, // 1 minute
168
+ });
169
+ ```
170
+
171
+ ### Presentation Script
172
+
173
+ Professional presentation scripts:
174
+
175
+ ```tsx
176
+ const result = await feature.generate(prompt, {
177
+ scriptType: 'presentation',
178
+ tone: 'professional',
179
+ duration: 600, // 10 minutes
180
+ });
181
+ ```
182
+
183
+ ## Tones
184
+
185
+ ### Casual
186
+
187
+ Conversational and friendly:
188
+
189
+ ```tsx
190
+ const result = await feature.generate(prompt, {
191
+ tone: 'casual',
192
+ });
193
+ ```
194
+
195
+ ### Professional
196
+
197
+ Formal and business-appropriate:
198
+
199
+ ```tsx
200
+ const result = await feature.generate(prompt, {
201
+ tone: 'professional',
202
+ });
203
+ ```
204
+
205
+ ### Humorous
206
+
207
+ Funny and entertaining:
208
+
209
+ ```tsx
210
+ const result = await feature.generate(prompt, {
211
+ tone: 'humorous',
212
+ });
213
+ ```
214
+
215
+ ### Dramatic
216
+
217
+ Emotional and engaging:
218
+
219
+ ```tsx
220
+ const result = await feature.generate(prompt, {
221
+ tone: 'dramatic',
222
+ });
223
+ ```
224
+
225
+ ## Usage Flow
226
+
227
+ 1. Enter **Topic** - Describe what the script is about
228
+ 2. Choose **Script Type** - Select the format
229
+ 3. Choose **Tone** - Select the tone/style
230
+ 4. Set **Duration** - Target length
231
+ 5. Tap **Generate** - Create the script
232
+ 6. View Result - Read and edit the script
233
+ 7. Save or Export - Save or export the script
234
+
235
+ ## Component Examples
236
+
237
+ ### Script Type Selector
238
+
239
+ ```tsx
240
+ import { GridSelector } from '@umituz/react-native-ai-generation-content';
241
+
242
+ const scriptTypes = [
243
+ { id: 'video', name: 'Video', description: 'With visual cues' },
244
+ { id: 'podcast', name: 'Podcast', description: 'Conversational' },
245
+ { id: 'social', name: 'Social Media', description: 'Short & engaging' },
246
+ { id: 'presentation', name: 'Presentation', description: 'Professional' },
247
+ ];
248
+
249
+ <GridSelector
250
+ options={scriptTypes}
251
+ selectedOption={selectedType}
252
+ onSelectOption={setSelectedType}
253
+ />
254
+ ```
255
+
256
+ ### Tone Selector
257
+
258
+ ```tsx
259
+ import { GridSelector } from '@umituz/react-native-ai-generation-content';
260
+
261
+ const tones = [
262
+ { id: 'casual', name: 'Casual', description: 'Friendly & relaxed' },
263
+ { id: 'professional', name: 'Professional', description: 'Formal & business' },
264
+ { id: 'humorous', name: 'Humorous', description: 'Funny & entertaining' },
265
+ { id: 'dramatic', name: 'Dramatic', description: 'Emotional & engaging' },
266
+ ];
267
+
268
+ <GridSelector
269
+ options={tones}
270
+ selectedOption={selectedTone}
271
+ onSelectOption={setSelectedTone}
272
+ />
273
+ ```
274
+
275
+ ### Duration Input
276
+
277
+ ```tsx
278
+ import { TextInput } from 'react-native';
279
+
280
+ <TextInput
281
+ placeholder="Duration (seconds)"
282
+ value={String(duration)}
283
+ onChangeText={(value) => setDuration(parseInt(value) || 60)}
284
+ keyboardType="numeric"
285
+ />
286
+ ```
287
+
288
+ ### Script Display
289
+
290
+ ```tsx
291
+ import { ScrollView, Text } from 'react-native';
292
+
293
+ <ScrollView style={{ padding: 16 }}>
294
+ <Text style={{ fontSize: 16, lineHeight: 24 }}>
295
+ {script}
296
+ </Text>
297
+ </ScrollView>
298
+ ```
299
+
300
+ ## Use Cases
301
+
302
+ ### YouTube Videos
303
+
304
+ ```tsx
305
+ // Generate YouTube video scripts
306
+ const result = await feature.generate('How to cook pasta', {
307
+ scriptType: 'video',
308
+ tone: 'casual',
309
+ duration: 600, // 10 minutes
310
+ });
311
+ ```
312
+
313
+ ### Podcast Episodes
314
+
315
+ ```tsx
316
+ // Generate podcast episode scripts
317
+ const result = await feature.generate('The future of AI', {
318
+ scriptType: 'podcast',
319
+ tone: 'casual',
320
+ duration: 3600, // 1 hour
321
+ });
322
+ ```
323
+
324
+ ### TikTok/Reels
325
+
326
+ ```tsx
327
+ // Generate short-form content
328
+ const result = await feature.generate('Quick workout tips', {
329
+ scriptType: 'social',
330
+ tone: 'energetic',
331
+ duration: 60,
332
+ });
333
+ ```
334
+
335
+ ### Business Presentations
336
+
337
+ ```tsx
338
+ // Generate presentation scripts
339
+ const result = await feature.generate('Q4 business review', {
340
+ scriptType: 'presentation',
341
+ tone: 'professional',
342
+ duration: 1200, // 20 minutes
343
+ });
344
+ ```
345
+
346
+ ## Best Practices
347
+
348
+ 1. **Clear Prompts**: Be specific about the topic and key points
349
+ 2. **Duration**: Set realistic duration targets
350
+ 3. **Tone Matching**: Match tone to your audience and purpose
351
+ 4. **Editing**: Always review and edit generated scripts
352
+ 5. **Visual Cues**: Use visual cues for video scripts
353
+
354
+ ## Related Features
355
+
356
+ - [Text to Voice](../text-to-voice) - Convert script to speech
357
+ - [Text to Video](../text-to-video) - Generate video from script
358
+ - [Audio Generation](../audio-generation) - Generate audio content
359
+
360
+ ## License
361
+
362
+ MIT