@umituz/react-native-ai-fal-provider 1.0.36 → 1.0.38
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.
|
|
3
|
+
"version": "1.0.38",
|
|
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",
|
|
@@ -21,7 +21,7 @@ export const FAL_IMAGE_FEATURE_MODELS: Record<ImageFeatureType, string> = {
|
|
|
21
21
|
"upscale": "fal-ai/clarity-upscaler",
|
|
22
22
|
"photo-restore": "fal-ai/aura-sr",
|
|
23
23
|
"face-swap": "fal-ai/face-swap",
|
|
24
|
-
"anime-selfie": "fal-ai/flux/
|
|
24
|
+
"anime-selfie": "fal-ai/flux-pro/kontext",
|
|
25
25
|
"remove-background": "fal-ai/bria/background/remove",
|
|
26
26
|
"remove-object": "fal-ai/flux-kontext-lora/inpaint",
|
|
27
27
|
"hd-touch-up": "fal-ai/clarity-upscaler",
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
buildRemoveBackgroundInput,
|
|
30
30
|
buildRemoveObjectInput,
|
|
31
31
|
buildReplaceBackgroundInput,
|
|
32
|
-
|
|
32
|
+
buildKontextStyleTransferInput,
|
|
33
33
|
buildVideoFromImageInput,
|
|
34
34
|
} from "../utils/input-builders.util";
|
|
35
35
|
|
|
@@ -213,13 +213,10 @@ export class FalProvider implements IAIProvider {
|
|
|
213
213
|
return buildReplaceBackgroundInput(imageBase64, { prompt, ...options });
|
|
214
214
|
|
|
215
215
|
case "anime-selfie":
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
strength: options?.strength as number,
|
|
221
|
-
num_inference_steps: options?.num_inference_steps as number,
|
|
222
|
-
guidance_scale: options?.guidance_scale as number,
|
|
216
|
+
return buildKontextStyleTransferInput(imageBase64, {
|
|
217
|
+
prompt: prompt || (options?.prompt as string) ||
|
|
218
|
+
"Transform this person into anime style illustration. Keep the same gender, face structure, hair color, eye color, and expression. Make it look like a high-quality anime character portrait with vibrant colors and clean lineart.",
|
|
219
|
+
guidance_scale: (options?.guidance_scale as number) ?? 4.0,
|
|
223
220
|
});
|
|
224
221
|
|
|
225
222
|
default:
|
|
@@ -231,7 +228,7 @@ export class FalProvider implements IAIProvider {
|
|
|
231
228
|
return FAL_VIDEO_FEATURE_MODELS[feature];
|
|
232
229
|
}
|
|
233
230
|
|
|
234
|
-
buildVideoFeatureInput(
|
|
231
|
+
buildVideoFeatureInput(_feature: VideoFeatureType, data: VideoFeatureInputData): Record<string, unknown> {
|
|
235
232
|
const { sourceImageBase64, targetImageBase64, prompt, options } = data;
|
|
236
233
|
|
|
237
234
|
return buildVideoFromImageInput(sourceImageBase64, {
|
|
@@ -169,3 +169,22 @@ export function buildHDTouchUpInput(
|
|
|
169
169
|
): Record<string, unknown> {
|
|
170
170
|
return buildUpscaleInput(base64, options);
|
|
171
171
|
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Build Kontext style transfer input for FAL flux-pro/kontext
|
|
175
|
+
* Instruction-based editing that preserves character identity
|
|
176
|
+
*/
|
|
177
|
+
export interface KontextStyleTransferOptions {
|
|
178
|
+
prompt: string;
|
|
179
|
+
guidance_scale?: number;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export function buildKontextStyleTransferInput(
|
|
183
|
+
base64: string,
|
|
184
|
+
options: KontextStyleTransferOptions,
|
|
185
|
+
): Record<string, unknown> {
|
|
186
|
+
return buildSingleImageInput(base64, {
|
|
187
|
+
prompt: options.prompt,
|
|
188
|
+
guidance_scale: options.guidance_scale ?? 3.5,
|
|
189
|
+
});
|
|
190
|
+
}
|