fix: Resolve Meshy stuck generation by fixing status string case matching and ai_model parameter
Build and Deploy / build-and-push (push) Successful in 25s
Build and Deploy / build-and-push (push) Successful in 25s
This commit is contained in:
@@ -306,7 +306,7 @@ export const ImageTo3DModal: React.FC<ImageTo3DModalProps> = ({ isOpen, onClose,
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (meshyModelType !== 'lowpoly') {
|
if (meshyModelType !== 'lowpoly') {
|
||||||
payload.ai_model = meshyAiModel;
|
payload.ai_model = meshyAiModel === 'latest' ? 'meshy-6' : meshyAiModel;
|
||||||
payload.should_remesh = meshyShouldRemesh;
|
payload.should_remesh = meshyShouldRemesh;
|
||||||
if (meshyShouldRemesh) {
|
if (meshyShouldRemesh) {
|
||||||
payload.topology = meshyTopology;
|
payload.topology = meshyTopology;
|
||||||
@@ -350,8 +350,9 @@ export const ImageTo3DModal: React.FC<ImageTo3DModalProps> = ({ isOpen, onClose,
|
|||||||
if (!pollRes.ok) throw new Error("Meshy API: Polling failed.");
|
if (!pollRes.ok) throw new Error("Meshy API: Polling failed.");
|
||||||
const pollData = await pollRes.json();
|
const pollData = await pollRes.json();
|
||||||
|
|
||||||
const status = pollData.status;
|
const status = (pollData.status || '').toUpperCase();
|
||||||
const progress = pollData.progress || 0;
|
const progress = pollData.progress || 0;
|
||||||
|
console.log("Meshy poll:", pollData); // Debug log
|
||||||
setProgressMessage(`Generating... ${progress}%`);
|
setProgressMessage(`Generating... ${progress}%`);
|
||||||
|
|
||||||
if (status === 'SUCCEEDED') {
|
if (status === 'SUCCEEDED') {
|
||||||
@@ -362,7 +363,7 @@ export const ImageTo3DModal: React.FC<ImageTo3DModalProps> = ({ isOpen, onClose,
|
|||||||
isDone = true;
|
isDone = true;
|
||||||
deductCredit();
|
deductCredit();
|
||||||
} else if (status === 'FAILED' || status === 'EXPIRED') {
|
} else if (status === 'FAILED' || status === 'EXPIRED') {
|
||||||
throw new Error(`Meshy API Task ${status}`);
|
throw new Error(`Meshy API Task ${status}: ${pollData.task_error?.message || 'Unknown error'}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user