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

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.194",
3
+ "version": "1.17.196",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -1,13 +1,12 @@
1
1
  /**
2
2
  * Couple Future Types
3
- * Identity-preserving image generation for couples
3
+ * Multi-reference image generation for couples using FLUX.2 Flex
4
4
  */
5
5
 
6
6
  export interface CoupleFutureInput {
7
7
  partnerABase64: string;
8
8
  partnerBBase64: string;
9
9
  prompt: string;
10
- negativePrompt?: string;
11
10
  }
12
11
 
13
12
  export interface CoupleFutureConfig {
@@ -23,9 +22,9 @@ export interface CoupleFutureResult {
23
22
  }
24
23
 
25
24
  export const COUPLE_FUTURE_DEFAULTS = {
26
- model: "fal-ai/pulid",
27
- negativePrompt: "ugly, deformed, blurry, low quality, watermark, text",
25
+ model: "fal-ai/flux-2-flex/edit",
28
26
  imageSize: "landscape_4_3" as const,
29
27
  timeoutMs: 300000,
30
- idMix: false,
28
+ numInferenceSteps: 28,
29
+ guidanceScale: 3.5,
31
30
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Couple Future Executor
3
- * Identity-preserving image generation using PuLID
3
+ * Multi-reference image generation using FLUX.2 Flex
4
4
  */
5
5
 
6
6
  import { providerRegistry } from "../../../infrastructure/services/provider-registry.service";
@@ -29,39 +29,52 @@ export async function executeCoupleFuture(
29
29
  }
30
30
 
31
31
  const { onProgress, timeoutMs, imageSize } = config ?? {};
32
+ let lastStatus = "";
32
33
 
33
34
  if (typeof __DEV__ !== "undefined" && __DEV__) {
34
- console.log("[CoupleFuture] Starting generation");
35
+ console.log("[CoupleFuture] Starting FLUX.2 Flex generation");
35
36
  }
36
37
 
37
38
  try {
38
39
  onProgress?.(5);
39
40
 
40
- const referenceImages = [input.partnerABase64, input.partnerBBase64]
41
+ const imageUrls = [input.partnerABase64, input.partnerBBase64]
41
42
  .filter(Boolean)
42
- .map((img) => ({ image_url: formatBase64(img) }));
43
+ .map(formatBase64);
43
44
 
44
- if (referenceImages.length === 0) {
45
- return { success: false, error: "At least one reference image required" };
45
+ if (imageUrls.length < 2) {
46
+ return { success: false, error: "Two reference images required" };
46
47
  }
47
48
 
48
49
  onProgress?.(10);
49
50
 
51
+ // Enhance prompt to reference both images
52
+ 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
+
50
54
  const modelInput = {
51
- reference_images: referenceImages,
52
- prompt: input.prompt,
53
- negative_prompt: input.negativePrompt || COUPLE_FUTURE_DEFAULTS.negativePrompt,
54
- num_images: 1,
55
+ image_urls: imageUrls,
56
+ prompt: enhancedPrompt,
55
57
  image_size: imageSize || COUPLE_FUTURE_DEFAULTS.imageSize,
56
- id_mix: COUPLE_FUTURE_DEFAULTS.idMix,
58
+ num_inference_steps: COUPLE_FUTURE_DEFAULTS.numInferenceSteps,
59
+ guidance_scale: COUPLE_FUTURE_DEFAULTS.guidanceScale,
60
+ output_format: "jpeg",
61
+ enable_safety_checker: true,
57
62
  };
58
63
 
64
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
65
+ console.log("[CoupleFuture] Prompt:", enhancedPrompt);
66
+ }
67
+
59
68
  const result = await provider.subscribe(COUPLE_FUTURE_DEFAULTS.model, modelInput, {
60
69
  timeoutMs: timeoutMs || COUPLE_FUTURE_DEFAULTS.timeoutMs,
61
70
  onQueueUpdate: (status) => {
71
+ if (status.status === lastStatus) return;
72
+ lastStatus = status.status;
73
+
62
74
  if (typeof __DEV__ !== "undefined" && __DEV__) {
63
- console.log("[CoupleFuture] Queue:", status.status);
75
+ console.log("[CoupleFuture] Status:", status.status);
64
76
  }
77
+
65
78
  if (status.status === "IN_QUEUE") onProgress?.(20);
66
79
  else if (status.status === "IN_PROGRESS") onProgress?.(50);
67
80
  },
@@ -69,7 +82,7 @@ export async function executeCoupleFuture(
69
82
 
70
83
  onProgress?.(90);
71
84
 
72
- const data = (result as { images?: Array<{ url: string }> });
85
+ const data = result as { images?: Array<{ url: string }> };
73
86
  const imageUrl = data?.images?.[0]?.url;
74
87
 
75
88
  onProgress?.(100);