@umituz/react-native-ai-fal-provider 1.0.30 → 1.0.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-fal-provider",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "description": "FAL AI provider for React Native - implements IAIProvider interface for unified AI generation",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -1,8 +1,63 @@
1
1
  /**
2
2
  * FAL Input Builders
3
3
  * Constructs FAL API input from normalized data
4
+ *
5
+ * NOTE: Once @umituz/react-native-ai-generation-content is published with
6
+ * ImagePromptBuilder, replace buildAnimeSelfiePrompt with:
7
+ *
8
+ * import { createAnimeSelfiePrompt, createStyleTransferPrompt }
9
+ * from "@umituz/react-native-ai-generation-content";
4
10
  */
5
11
 
12
+ // =============================================================================
13
+ // INTERNAL PROMPT BUILDING (temporary - will use ImagePromptBuilder after publish)
14
+ // =============================================================================
15
+
16
+ const ANIME_SELFIE_PROMPT = [
17
+ // Anime style FIRST - highest priority
18
+ "anime style portrait",
19
+ "2D anime illustration",
20
+ "japanese anime art style",
21
+ "cel-shaded anime character",
22
+ "large sparkling anime eyes with detailed iris",
23
+ "smooth cel-shaded skin with subtle anime blush",
24
+ "stylized anime hair with highlights",
25
+ "Studio Ghibli inspired",
26
+ "vibrant anime colors",
27
+ "clean anime lineart",
28
+ "professional anime portrait",
29
+ "hand drawn anime",
30
+ "manga style",
31
+ // Identity preservation - secondary
32
+ "same person",
33
+ "preserve original gender",
34
+ "same facial features",
35
+ ].join(", ");
36
+
37
+ const ANIME_SELFIE_NEGATIVE_PROMPT = [
38
+ // Identity negative
39
+ "gender swap",
40
+ "different person",
41
+ "wrong gender",
42
+ "changed identity",
43
+ // Anti-realism
44
+ "photorealistic",
45
+ "realistic photo",
46
+ "3D render",
47
+ "hyperrealistic",
48
+ "real person",
49
+ "natural skin texture",
50
+ "pores",
51
+ "wrinkles",
52
+ // Anatomy negative
53
+ "deformed face",
54
+ "bad anatomy",
55
+ "extra limbs",
56
+ "mutated hands",
57
+ "extra fingers",
58
+ "missing fingers",
59
+ ].join(", ");
60
+
6
61
  // =============================================================================
7
62
  // TYPES
8
63
  // =============================================================================
@@ -144,43 +199,24 @@ export function buildFaceSwapInput(
144
199
  /**
145
200
  * Build anime selfie input for FAL flux/dev/image-to-image
146
201
  * Transforms person's photo to anime style while preserving facial features
202
+ *
203
+ * Uses comprehensive identity preservation + anime style prompts
204
+ * After @umituz/react-native-ai-generation-content publish, will use ImagePromptBuilder
147
205
  */
148
206
  export function buildAnimeSelfieInput(
149
207
  base64: string,
150
208
  options?: AnimeSelfieOptions,
151
209
  ): Record<string, unknown> {
152
- const basePrompt = [
153
- // Identity preservation - CRITICAL
154
- "same person",
155
- "preserve original face structure",
156
- "preserve original gender",
157
- "preserve original hair color and style",
158
- "preserve original eye color",
159
- "same facial features",
160
- // Anime style
161
- "2D anime illustration",
162
- "japanese anime art style",
163
- "cel-shaded anime character",
164
- "large sparkling anime eyes with detailed iris",
165
- "smooth cel-shaded skin with subtle anime blush",
166
- "stylized anime hair with highlights",
167
- "Studio Ghibli inspired",
168
- "vibrant anime colors",
169
- "clean anime lineart",
170
- "professional anime portrait",
171
- ].join(", ");
172
-
173
- const stylePrompt = options?.style
174
- ? `${options.style} style, ${basePrompt}`
175
- : basePrompt;
210
+ const prompt = options?.style
211
+ ? `${options.style} style, ${ANIME_SELFIE_PROMPT}`
212
+ : ANIME_SELFIE_PROMPT;
176
213
 
177
214
  return buildSingleImageInput(base64, {
178
- prompt: stylePrompt,
179
- negative_prompt:
180
- "gender swap, different person, wrong gender, photorealistic, realistic photo, 3D render, hyperrealistic, deformed face, bad anatomy, extra limbs",
181
- strength: 0.75,
215
+ prompt,
216
+ negative_prompt: ANIME_SELFIE_NEGATIVE_PROMPT,
217
+ strength: 0.92,
182
218
  num_inference_steps: 50,
183
- guidance_scale: 7.5,
219
+ guidance_scale: 8.5,
184
220
  });
185
221
  }
186
222