@umituz/react-native-ai-generation-content 1.30.0 → 1.31.0

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.30.0",
3
+ "version": "1.31.0",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -13,6 +13,7 @@ import {
13
13
  PHOTO_KEY_PREFIX,
14
14
  DEFAULT_STYLE_VALUE,
15
15
  MODEL_INPUT_DEFAULTS,
16
+ IMAGE_PROCESSING_PROMPTS,
16
17
  } from "./wizard-strategy.constants";
17
18
  import { buildFacePreservationPrompt } from "../../../../prompts/infrastructure/builders/face-preservation-builder";
18
19
  import { buildInteractionStylePrompt, type InteractionStyle } from "../../../../prompts/infrastructure/builders/interaction-style-builder";
@@ -167,10 +168,19 @@ export async function buildImageInput(
167
168
  const photos = await extractPhotosFromWizardData(wizardData);
168
169
 
169
170
  // Extract prompt using type-safe extractor with fallback
170
- const prompt = extractPrompt(wizardData, scenario.aiPrompt);
171
+ let prompt = extractPrompt(wizardData, scenario.aiPrompt);
171
172
 
173
+ // For image processing features, use default prompt if none provided
172
174
  if (!prompt) {
173
- throw new Error("Prompt is required for image generation");
175
+ const defaultPrompt = IMAGE_PROCESSING_PROMPTS[scenario.id];
176
+ if (defaultPrompt) {
177
+ prompt = defaultPrompt;
178
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
179
+ console.log("[ImageStrategy] Using default prompt for", scenario.id);
180
+ }
181
+ } else {
182
+ throw new Error("Prompt is required for image generation");
183
+ }
174
184
  }
175
185
 
176
186
  // For photo-based generation, apply style enhancements
@@ -32,3 +32,15 @@ export const VIDEO_FEATURE_PATTERNS: Record<string, VideoFeatureType> = {
32
32
  "text-to-video": "text-to-video",
33
33
  "image-to-video": "image-to-video",
34
34
  };
35
+
36
+ /** Default prompts for image processing features (no user input needed) */
37
+ export const IMAGE_PROCESSING_PROMPTS: Record<string, string> = {
38
+ upscale: "Enhance and upscale this image to higher resolution with improved details and clarity",
39
+ "face-swap": "Swap the face from the source image onto the target image naturally",
40
+ "anime-selfie": "Transform this photo into a high-quality anime-style portrait",
41
+ "photo-restore": "Restore and enhance this photo, fix damage and improve quality",
42
+ "remove-background": "Remove the background completely, keep only the main subject",
43
+ "remove-object": "Remove unwanted objects from the image while preserving the scene",
44
+ "replace-background": "Replace the background with a new seamless environment",
45
+ "hd-touch-up": "Apply HD touch-up to enhance skin and facial features naturally",
46
+ };