Skip to content

Commit 77e9489

Browse files
myxamediyarclaude
andcommitted
fix(higgsfield): type character list output and limit SOUL batch size
Declare the List Characters output as an array, and reject a SOUL batch size other than 1 or 4 before submitting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent e4c960f commit 77e9489

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎apps/sim/blocks/blocks/higgsfield.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,11 @@ export const HiggsfieldBlock: BlockConfig = {
397397
description:
398398
'Character (id, name, modelVersion, status, thumbnailUrl, createdAt, inProgressAt, failReason)',
399399
},
400-
characters: { type: 'json', description: 'Characters on this page' },
400+
characters: {
401+
type: 'array',
402+
description:
403+
'Characters on this page (id, name, modelVersion, status, thumbnailUrl, createdAt, inProgressAt, failReason)',
404+
},
401405
characterId: { type: 'string', description: 'ID of the deleted character' },
402406
total: { type: 'number', description: 'Total number of characters' },
403407
page: { type: 'number', description: 'Current page number' },

‎apps/sim/tools/higgsfield/generate_soul_image.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
import type { ToolConfig } from '@/tools/types'
1515

1616
const SOUL_ENDPOINT = 'higgsfield-ai/soul/standard'
17+
const SOUL_BATCH_SIZES = new Set([1, 4])
1718

1819
export const higgsfieldGenerateSoulImageTool: ToolConfig<
1920
HiggsfieldGenerateSoulImageParams,
@@ -104,7 +105,12 @@ export const higgsfieldGenerateSoulImageTool: ToolConfig<
104105
const body: Record<string, unknown> = { prompt: params.prompt }
105106
if (params.aspectRatio) body.aspect_ratio = params.aspectRatio
106107
if (params.resolution) body.resolution = params.resolution
107-
if (params.batchSize !== undefined) body.batch_size = params.batchSize
108+
if (params.batchSize !== undefined) {
109+
if (!SOUL_BATCH_SIZES.has(params.batchSize)) {
110+
throw new Error('Number of images must be 1 or 4')
111+
}
112+
body.batch_size = params.batchSize
113+
}
108114
if (params.styleId?.trim()) body.style_id = params.styleId.trim()
109115
if (params.styleStrength !== undefined) body.style_strength = params.styleStrength
110116
if (params.characterId?.trim()) body.custom_reference_id = params.characterId.trim()

0 commit comments

Comments
 (0)