Skip to content

Commit ff14809

Browse files
committed
FAL image settings escape hatch
1 parent a0992ff commit ff14809

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

packages/core/src/generation.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ export const generateImage = async (
907907
const blob = await imageResponse.blob();
908908
const arrayBuffer = await blob.arrayBuffer();
909909
const base64 = Buffer.from(arrayBuffer).toString('base64');
910-
910+
911911
// Return with proper MIME type
912912
return `data:image/jpeg;base64,${base64}`;
913913
}));
@@ -930,7 +930,8 @@ export const generateImage = async (
930930
num_inference_steps: modelSettings?.steps ?? 50,
931931
guidance_scale: data.guidanceScale || 3.5,
932932
num_images: data.count,
933-
enable_safety_checker: true,
933+
enable_safety_checker: modelSettings?.fal?.enableSafetyChecker ?? true,
934+
safety_tolerance: modelSettings?.fal?.safetyTolerance ?? 2,
934935
output_format: "png" as const,
935936
seed: data.seed ?? 6252023,
936937
...(runtime.getSetting("FAL_AI_LORA_PATH")

packages/core/src/models.ts

+4
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ export const models: Models = {
315315
},
316316
imageSettings: {
317317
steps: 28,
318+
fal: {
319+
enableSafetyChecker: true,
320+
safetyTolerance: 2,
321+
},
318322
},
319323
endpoint: "https://api.fal.ai/v1",
320324
model: {

packages/core/src/types.ts

+4
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ export type Model = {
170170
/** Optional image generation settings */
171171
imageSettings?: {
172172
steps?: number;
173+
fal?: {
174+
enableSafetyChecker: boolean;
175+
safetyTolerance: number;
176+
};
173177
};
174178

175179
/** Model names by size class */

0 commit comments

Comments
 (0)