@umituz/react-native-ai-generation-content 1.17.139 → 1.17.141
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,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Image-to-Video Executor
|
|
3
3
|
* Provider-agnostic image-to-video execution using active AI provider
|
|
4
|
+
* Matches text-to-video pattern for consistency
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
7
|
import { providerRegistry } from "../../../../infrastructure/services";
|
|
7
|
-
import { cleanBase64 } from "../../../../infrastructure/utils";
|
|
8
8
|
import type {
|
|
9
9
|
ImageToVideoRequest,
|
|
10
10
|
ImageToVideoResult,
|
|
@@ -50,13 +50,26 @@ export async function executeImageToVideo(
|
|
|
50
50
|
request: ImageToVideoRequest,
|
|
51
51
|
options: ExecuteImageToVideoOptions,
|
|
52
52
|
): Promise<ImageToVideoResult> {
|
|
53
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
54
|
+
// eslint-disable-next-line no-console
|
|
55
|
+
console.log("[ImageToVideoExecutor] executeImageToVideo() called");
|
|
56
|
+
}
|
|
57
|
+
|
|
53
58
|
const provider = providerRegistry.getActiveProvider();
|
|
54
59
|
|
|
55
60
|
if (!provider) {
|
|
61
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
62
|
+
// eslint-disable-next-line no-console
|
|
63
|
+
console.error("[ImageToVideoExecutor] No AI provider configured");
|
|
64
|
+
}
|
|
56
65
|
return { success: false, error: "No AI provider configured" };
|
|
57
66
|
}
|
|
58
67
|
|
|
59
68
|
if (!provider.isInitialized()) {
|
|
69
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
70
|
+
// eslint-disable-next-line no-console
|
|
71
|
+
console.error("[ImageToVideoExecutor] AI provider not initialized");
|
|
72
|
+
}
|
|
60
73
|
return { success: false, error: "AI provider not initialized" };
|
|
61
74
|
}
|
|
62
75
|
|
|
@@ -68,26 +81,46 @@ export async function executeImageToVideo(
|
|
|
68
81
|
|
|
69
82
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
70
83
|
// eslint-disable-next-line no-console
|
|
71
|
-
console.log(`[
|
|
84
|
+
console.log(`[ImageToVideoExecutor] Provider: ${provider.providerId}, Model: ${model}`);
|
|
72
85
|
}
|
|
73
86
|
|
|
74
87
|
try {
|
|
75
|
-
onProgress?.(
|
|
88
|
+
onProgress?.(5);
|
|
76
89
|
|
|
77
|
-
|
|
78
|
-
|
|
90
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
91
|
+
// eslint-disable-next-line no-console
|
|
92
|
+
console.log("[ImageToVideoExecutor] Starting provider.run()...");
|
|
93
|
+
}
|
|
79
94
|
|
|
80
|
-
|
|
81
|
-
|
|
95
|
+
// Build input directly - let buildInput handle base64 format
|
|
96
|
+
const input = buildInput(request.imageBase64, request.motionPrompt, request.options);
|
|
97
|
+
|
|
98
|
+
// Call provider.run with onProgress like text-to-video does
|
|
99
|
+
const result = await provider.run(model, input, {
|
|
100
|
+
onProgress: (progressInfo) => {
|
|
101
|
+
const progressValue = progressInfo.progress;
|
|
102
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
103
|
+
// eslint-disable-next-line no-console
|
|
104
|
+
console.log("[ImageToVideoExecutor] Progress:", progressValue);
|
|
105
|
+
}
|
|
106
|
+
onProgress?.(progressValue);
|
|
107
|
+
},
|
|
108
|
+
});
|
|
82
109
|
|
|
83
|
-
|
|
84
|
-
|
|
110
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
111
|
+
// eslint-disable-next-line no-console
|
|
112
|
+
console.log("[ImageToVideoExecutor] provider.run() completed");
|
|
113
|
+
}
|
|
85
114
|
|
|
86
115
|
const extractor = extractResult || defaultExtractResult;
|
|
87
116
|
const extracted = extractor(result);
|
|
88
117
|
onProgress?.(100);
|
|
89
118
|
|
|
90
119
|
if (!extracted?.videoUrl) {
|
|
120
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
121
|
+
// eslint-disable-next-line no-console
|
|
122
|
+
console.error("[ImageToVideoExecutor] No video URL in response");
|
|
123
|
+
}
|
|
91
124
|
return { success: false, error: "No video in response" };
|
|
92
125
|
}
|
|
93
126
|
|
|
@@ -100,7 +133,7 @@ export async function executeImageToVideo(
|
|
|
100
133
|
const message = error instanceof Error ? error.message : String(error);
|
|
101
134
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
102
135
|
// eslint-disable-next-line no-console
|
|
103
|
-
console.error("[
|
|
136
|
+
console.error("[ImageToVideoExecutor] Error:", message);
|
|
104
137
|
}
|
|
105
138
|
return { success: false, error: message };
|
|
106
139
|
}
|
|
@@ -77,7 +77,7 @@ export function useImageToVideoFeature(
|
|
|
77
77
|
|
|
78
78
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
79
79
|
// eslint-disable-next-line no-console
|
|
80
|
-
console.log("[ImageToVideoFeature] Starting generation:",
|
|
80
|
+
console.log("[ImageToVideoFeature] Starting generation, creationId:", creationId);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
config.onProcessingStart?.();
|
|
@@ -184,11 +184,7 @@ export function useImageToVideoFeature(
|
|
|
184
184
|
|
|
185
185
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
186
186
|
// eslint-disable-next-line no-console
|
|
187
|
-
console.log("[ImageToVideoFeature] generate called:",
|
|
188
|
-
paramImageUri,
|
|
189
|
-
stateImageUri: state.imageUri,
|
|
190
|
-
effectiveImageUri,
|
|
191
|
-
});
|
|
187
|
+
console.log("[ImageToVideoFeature] generate called, hasImage:", !!effectiveImageUri);
|
|
192
188
|
}
|
|
193
189
|
|
|
194
190
|
if (!effectiveImageUri) {
|