@umituz/react-native-ai-pruna-provider 1.0.38 → 1.0.40
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.
|
|
3
|
+
"version": "1.0.40",
|
|
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",
|
|
@@ -188,15 +188,31 @@ async function buildImageEditInput(
|
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
// Optional parameters for quality control
|
|
191
192
|
if (input.seed !== undefined) payload.seed = input.seed;
|
|
192
193
|
if (input.disable_safety_checker !== undefined) payload.disable_safety_checker = input.disable_safety_checker;
|
|
193
194
|
if (input.width !== undefined) payload.width = input.width;
|
|
194
195
|
if (input.height !== undefined) payload.height = input.height;
|
|
195
196
|
|
|
197
|
+
// Advanced quality parameters
|
|
198
|
+
if (input.num_inference_steps !== undefined) {
|
|
199
|
+
payload.num_inference_steps = input.num_inference_steps;
|
|
200
|
+
generationLogCollector.log(sessionId, TAG, `Added num_inference_steps: ${input.num_inference_steps}`);
|
|
201
|
+
}
|
|
202
|
+
if (input.guidance_scale !== undefined) {
|
|
203
|
+
payload.guidance_scale = input.guidance_scale;
|
|
204
|
+
generationLogCollector.log(sessionId, TAG, `Added guidance_scale: ${input.guidance_scale}`);
|
|
205
|
+
}
|
|
206
|
+
if (input.strength !== undefined) {
|
|
207
|
+
payload.strength = input.strength;
|
|
208
|
+
generationLogCollector.log(sessionId, TAG, `Added strength: ${input.strength}`);
|
|
209
|
+
}
|
|
210
|
+
|
|
196
211
|
generationLogCollector.log(sessionId, TAG, `<<< buildImageEditInput COMPLETE`, {
|
|
197
212
|
payloadKeys: Object.keys(payload),
|
|
198
213
|
imageCount: imageUrls.length,
|
|
199
214
|
hasSeed: !!payload.seed,
|
|
215
|
+
hasQualityParams: !!(payload.num_inference_steps || payload.guidance_scale || payload.strength),
|
|
200
216
|
});
|
|
201
217
|
|
|
202
218
|
return payload;
|
|
@@ -157,9 +157,14 @@ async function singleSubscribeAttempt<T = unknown>(
|
|
|
157
157
|
requestId,
|
|
158
158
|
});
|
|
159
159
|
|
|
160
|
-
// Wrap result in expected format
|
|
161
|
-
// Pruna returns a URL string — wrap in
|
|
162
|
-
const result = { url: resultUrl } as T;
|
|
160
|
+
// Wrap result in expected format for AI generation content
|
|
161
|
+
// Pruna returns a URL string — wrap in { images: [{ url }] } format
|
|
162
|
+
const result = { images: [{ url: resultUrl }] } as T;
|
|
163
|
+
|
|
164
|
+
generationLogCollector.log(sessionId, TAG, `Result wrapped for AI generation content`, {
|
|
165
|
+
format: 'images: [{ url }]',
|
|
166
|
+
urlPrefix: resultUrl.substring(0, 80) + '...',
|
|
167
|
+
});
|
|
163
168
|
|
|
164
169
|
return { result, requestId };
|
|
165
170
|
}
|
|
@@ -282,7 +287,9 @@ export async function handlePrunaRun<T = unknown>(
|
|
|
282
287
|
generationLogCollector.log(sessionId, runTag, `Run completed in ${elapsed}ms`);
|
|
283
288
|
|
|
284
289
|
options?.onProgress?.({ progress: 100, status: "COMPLETED" as const });
|
|
285
|
-
|
|
290
|
+
|
|
291
|
+
// Wrap result in expected format for AI generation content
|
|
292
|
+
return { images: [{ url: resultUrl }] } as T;
|
|
286
293
|
} catch (error) {
|
|
287
294
|
const elapsed = Date.now() - startTime;
|
|
288
295
|
const message = error instanceof Error ? error.message : String(error);
|