@umituz/react-native-ai-pruna-provider 1.0.4 → 1.0.5

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-pruna-provider",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Pruna AI provider for React Native - implements IAIProvider interface for unified AI generation",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -79,12 +79,16 @@ export interface PrunaPredictionInput {
79
79
  readonly aspect_ratio?: PrunaAspectRatio;
80
80
  readonly image?: string;
81
81
  readonly images?: readonly string[];
82
+ readonly reference_image?: string;
82
83
  readonly duration?: number;
83
84
  readonly resolution?: PrunaResolution;
84
85
  readonly fps?: number;
85
86
  readonly draft?: boolean;
86
87
  readonly prompt_upsampling?: boolean;
87
88
  readonly seed?: number;
89
+ readonly disable_safety_checker?: boolean;
90
+ readonly width?: number;
91
+ readonly height?: number;
88
92
  }
89
93
 
90
94
  /**
@@ -54,9 +54,10 @@ function buildImageInput(
54
54
  ): Record<string, unknown> {
55
55
  const payload: Record<string, unknown> = { prompt, aspect_ratio: aspectRatio };
56
56
 
57
- if (input.seed !== undefined) {
58
- payload.seed = input.seed;
59
- }
57
+ if (input.seed !== undefined) payload.seed = input.seed;
58
+ if (input.disable_safety_checker !== undefined) payload.disable_safety_checker = input.disable_safety_checker;
59
+ if (input.width !== undefined) payload.width = input.width;
60
+ if (input.height !== undefined) payload.height = input.height;
60
61
 
61
62
  return payload;
62
63
  }
@@ -86,8 +87,14 @@ function buildImageEditInput(
86
87
 
87
88
  const payload: Record<string, unknown> = { images, prompt, aspect_ratio: aspectRatio };
88
89
 
89
- if (input.seed !== undefined) {
90
- payload.seed = input.seed;
90
+ if (input.seed !== undefined) payload.seed = input.seed;
91
+ if (input.disable_safety_checker !== undefined) payload.disable_safety_checker = input.disable_safety_checker;
92
+ if (input.width !== undefined) payload.width = input.width;
93
+ if (input.height !== undefined) payload.height = input.height;
94
+
95
+ // reference_image: designates the primary/main image in multi-image edits
96
+ if (typeof input.reference_image === 'string') {
97
+ payload.reference_image = stripBase64Prefix(input.reference_image);
91
98
  }
92
99
 
93
100
  return payload;
@@ -114,14 +121,21 @@ async function buildVideoInput(
114
121
  const resolution = (input.resolution as PrunaResolution) ?? P_VIDEO_DEFAULTS.resolution;
115
122
  const draft = (input.draft as boolean) ?? P_VIDEO_DEFAULTS.draft;
116
123
 
117
- return {
124
+ const fps = (input.fps as number) ?? P_VIDEO_DEFAULTS.fps;
125
+ const promptUpsampling = (input.prompt_upsampling as boolean) ?? P_VIDEO_DEFAULTS.promptUpsampling;
126
+
127
+ const payload: Record<string, unknown> = {
118
128
  image: fileUrl,
119
129
  prompt,
120
130
  duration,
121
131
  resolution,
122
- fps: P_VIDEO_DEFAULTS.fps,
132
+ fps,
123
133
  draft,
124
134
  aspect_ratio: aspectRatio,
125
- prompt_upsampling: P_VIDEO_DEFAULTS.promptUpsampling,
135
+ prompt_upsampling: promptUpsampling,
126
136
  };
137
+
138
+ if (input.disable_safety_checker !== undefined) payload.disable_safety_checker = input.disable_safety_checker;
139
+
140
+ return payload;
127
141
  }