@umituz/react-native-ai-generation-content 1.17.196 → 1.17.198

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-generation-content",
3
- "version": "1.17.196",
3
+ "version": "1.17.198",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -1,8 +1,23 @@
1
1
  /**
2
2
  * Couple Future Types
3
- * Multi-reference image generation for couples using FLUX.2 Flex
3
+ * Multi-reference image generation for couples using Nano Banana
4
4
  */
5
5
 
6
+ export type NanoBananaAspectRatio =
7
+ | "auto"
8
+ | "21:9"
9
+ | "16:9"
10
+ | "3:2"
11
+ | "4:3"
12
+ | "5:4"
13
+ | "1:1"
14
+ | "4:5"
15
+ | "3:4"
16
+ | "2:3"
17
+ | "9:16";
18
+
19
+ export type NanoBananaOutputFormat = "jpeg" | "png" | "webp";
20
+
6
21
  export interface CoupleFutureInput {
7
22
  partnerABase64: string;
8
23
  partnerBBase64: string;
@@ -11,7 +26,8 @@ export interface CoupleFutureInput {
11
26
 
12
27
  export interface CoupleFutureConfig {
13
28
  timeoutMs?: number;
14
- imageSize?: "square_hd" | "square" | "portrait_4_3" | "portrait_16_9" | "landscape_4_3" | "landscape_16_9";
29
+ aspectRatio?: NanoBananaAspectRatio;
30
+ outputFormat?: NanoBananaOutputFormat;
15
31
  onProgress?: (progress: number) => void;
16
32
  }
17
33
 
@@ -22,9 +38,8 @@ export interface CoupleFutureResult {
22
38
  }
23
39
 
24
40
  export const COUPLE_FUTURE_DEFAULTS = {
25
- model: "fal-ai/flux-2-flex/edit",
26
- imageSize: "landscape_4_3" as const,
41
+ model: "fal-ai/nano-banana/edit",
42
+ aspectRatio: "4:3" as NanoBananaAspectRatio,
43
+ outputFormat: "jpeg" as NanoBananaOutputFormat,
27
44
  timeoutMs: 300000,
28
- numInferenceSteps: 28,
29
- guidanceScale: 3.5,
30
45
  };
@@ -1,8 +1,14 @@
1
1
  /**
2
2
  * Couple Future Feature
3
- * Identity-preserving image generation for couples
3
+ * Identity-preserving image generation for couples using Nano Banana
4
4
  */
5
5
 
6
6
  export { executeCoupleFuture } from "./infrastructure/executor";
7
- export type { CoupleFutureInput, CoupleFutureConfig, CoupleFutureResult } from "./domain/types";
7
+ export type {
8
+ CoupleFutureInput,
9
+ CoupleFutureConfig,
10
+ CoupleFutureResult,
11
+ NanoBananaAspectRatio,
12
+ NanoBananaOutputFormat,
13
+ } from "./domain/types";
8
14
  export { COUPLE_FUTURE_DEFAULTS } from "./domain/types";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Couple Future Executor
3
- * Multi-reference image generation using FLUX.2 Flex
3
+ * Multi-reference image generation using Nano Banana
4
4
  */
5
5
 
6
6
  import { providerRegistry } from "../../../infrastructure/services/provider-registry.service";
@@ -28,11 +28,11 @@ export async function executeCoupleFuture(
28
28
  return { success: false, error: "AI provider not initialized" };
29
29
  }
30
30
 
31
- const { onProgress, timeoutMs, imageSize } = config ?? {};
31
+ const { onProgress, timeoutMs, aspectRatio, outputFormat } = config ?? {};
32
32
  let lastStatus = "";
33
33
 
34
34
  if (typeof __DEV__ !== "undefined" && __DEV__) {
35
- console.log("[CoupleFuture] Starting FLUX.2 Flex generation");
35
+ console.log("[CoupleFuture] Starting Nano Banana generation");
36
36
  }
37
37
 
38
38
  try {
@@ -48,17 +48,14 @@ export async function executeCoupleFuture(
48
48
 
49
49
  onProgress?.(10);
50
50
 
51
- // Enhance prompt to reference both images
52
51
  const enhancedPrompt = `A photorealistic image of a couple. The first person @image1 and the second person @image2. ${input.prompt}. High quality, detailed, professional photography.`;
53
52
 
54
53
  const modelInput = {
55
54
  image_urls: imageUrls,
56
55
  prompt: enhancedPrompt,
57
- image_size: imageSize || COUPLE_FUTURE_DEFAULTS.imageSize,
58
- num_inference_steps: COUPLE_FUTURE_DEFAULTS.numInferenceSteps,
59
- guidance_scale: COUPLE_FUTURE_DEFAULTS.guidanceScale,
60
- output_format: "jpeg",
61
- enable_safety_checker: true,
56
+ aspect_ratio: aspectRatio ?? COUPLE_FUTURE_DEFAULTS.aspectRatio,
57
+ output_format: outputFormat ?? COUPLE_FUTURE_DEFAULTS.outputFormat,
58
+ num_images: 1,
62
59
  };
63
60
 
64
61
  if (typeof __DEV__ !== "undefined" && __DEV__) {
@@ -66,7 +63,7 @@ export async function executeCoupleFuture(
66
63
  }
67
64
 
68
65
  const result = await provider.subscribe(COUPLE_FUTURE_DEFAULTS.model, modelInput, {
69
- timeoutMs: timeoutMs || COUPLE_FUTURE_DEFAULTS.timeoutMs,
66
+ timeoutMs: timeoutMs ?? COUPLE_FUTURE_DEFAULTS.timeoutMs,
70
67
  onQueueUpdate: (status) => {
71
68
  if (status.status === lastStatus) return;
72
69
  lastStatus = status.status;
@@ -82,9 +79,20 @@ export async function executeCoupleFuture(
82
79
 
83
80
  onProgress?.(90);
84
81
 
85
- const data = result as { images?: Array<{ url: string }> };
82
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
83
+ console.log("[CoupleFuture] Raw result:", JSON.stringify(result, null, 2));
84
+ console.log("[CoupleFuture] Result keys:", result ? Object.keys(result as object) : "null");
85
+ }
86
+
87
+ const rawResult = result as Record<string, unknown>;
88
+ const data = (rawResult?.data ?? rawResult) as { images?: Array<{ url: string }> };
86
89
  const imageUrl = data?.images?.[0]?.url;
87
90
 
91
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
92
+ console.log("[CoupleFuture] Parsed data:", JSON.stringify(data, null, 2));
93
+ console.log("[CoupleFuture] Image URL:", imageUrl);
94
+ }
95
+
88
96
  onProgress?.(100);
89
97
 
90
98
  if (!imageUrl) {