Skip to content

Commit

Permalink
Allow configuring FAL safety settings
Browse files Browse the repository at this point in the history
  • Loading branch information
daojonesceo committed Dec 3, 2024
1 parent a0992ff commit eed8b06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/core/src/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ export const generateImage = async (
const blob = await imageResponse.blob();
const arrayBuffer = await blob.arrayBuffer();
const base64 = Buffer.from(arrayBuffer).toString('base64');

// Return with proper MIME type
return `data:image/jpeg;base64,${base64}`;
}));
Expand All @@ -930,7 +930,8 @@ export const generateImage = async (
num_inference_steps: modelSettings?.steps ?? 50,
guidance_scale: data.guidanceScale || 3.5,
num_images: data.count,
enable_safety_checker: true,
enable_safety_checker: runtime.getSetting("FAL_AI_ENABLE_SAFETY_CHECKER") === "true",
safety_tolerance: Number(runtime.getSetting("FAL_AI_SAFETY_TOLERANCE") || "2"),
output_format: "png" as const,
seed: data.seed ?? 6252023,
...(runtime.getSetting("FAL_AI_LORA_PATH")
Expand Down

0 comments on commit eed8b06

Please sign in to comment.