Skip to content

Commit dcd3839

Browse files
authored
Merge pull request #75 from timoncool/devin/1730055000-fix-flux-kontext-validation
Fix: Add UI validation for models requiring inputAsset
2 parents b47d43b + 8bf2b6d commit dcd3839

4 files changed

Lines changed: 36 additions & 7 deletions

File tree

messages/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@
9292
"imaginePlaceholder": "Imagine...",
9393
"enhancePrompt": "Enhance Prompt",
9494
"duration": "Duration",
95-
"generate": "Generate"
95+
"generate": "Generate",
96+
"thisModelRequiresAsset": "This model requires an asset to be selected"
9697
},
9798
"videoPreview": {
9899
"export": "Export"

messages/ru.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@
9292
"imaginePlaceholder": "Представьте...",
9393
"enhancePrompt": "Улучшить запрос",
9494
"duration": "Длительность",
95-
"generate": "Сгенерировать"
95+
"generate": "Сгенерировать",
96+
"thisModelRequiresAsset": "Эта модель требует выбора ресурса"
9697
},
9798
"videoPreview": {
9899
"export": "Экспорт"

src/components/right-panel.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,10 +1016,27 @@ export default function RightPanel({
10161016
</AccordionContent>
10171017
</AccordionItem>
10181018
</Accordion>
1019-
<div className="flex flex-row gap-2">
1019+
<div className="flex flex-col gap-2">
1020+
{endpoint?.inputAsset?.some((asset) => {
1021+
const assetType = getAssetType(asset);
1022+
const assetKey = getAssetKey(asset);
1023+
return !generateData[assetKey];
1024+
}) && (
1025+
<div className="text-xs text-muted-foreground text-center">
1026+
{t("thisModelRequiresAsset")}
1027+
</div>
1028+
)}
10201029
<Button
10211030
className="w-full"
1022-
disabled={enhance.isPending || createJob.isPending}
1031+
disabled={
1032+
enhance.isPending ||
1033+
createJob.isPending ||
1034+
endpoint?.inputAsset?.some((asset) => {
1035+
const assetType = getAssetType(asset);
1036+
const assetKey = getAssetKey(asset);
1037+
return !generateData[assetKey];
1038+
})
1039+
}
10231040
onClick={handleOnGenerate}
10241041
>
10251042
{t("generate")}

src/data/mutations.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,19 @@ export const useJobCreator = ({
6464

6565
if (provider === "fal") {
6666
console.log("[DEBUG] FAL - submitting with endpointId:", endpointId);
67-
const result = await fal.queue.submit(endpointId, { input });
68-
console.log("[DEBUG] FAL submit result:", result);
69-
return result;
67+
console.log("[DEBUG] FAL - input payload:", JSON.stringify(input, null, 2));
68+
try {
69+
const result = await fal.queue.submit(endpointId, { input });
70+
console.log("[DEBUG] FAL submit result:", result);
71+
return result;
72+
} catch (error: any) {
73+
console.error("[DEBUG] FAL submit ERROR:", error);
74+
console.error("[DEBUG] FAL submit ERROR message:", error?.message);
75+
console.error("[DEBUG] FAL submit ERROR status:", error?.status);
76+
console.error("[DEBUG] FAL submit ERROR body:", error?.body);
77+
console.error("[DEBUG] FAL submit ERROR response:", error?.response);
78+
throw error;
79+
}
7080
}
7181
const runware = await getRunwareClient();
7282
if (!runware) {

0 commit comments

Comments
 (0)