enzostvs HF staff commited on
Commit
d5438cc
β€’
1 Parent(s): 4f8c547

delete negative prompt if base model is flux

Browse files
Files changed (1) hide show
  1. src/routes/api/generate/+server.ts +5 -0
src/routes/api/generate/+server.ts CHANGED
@@ -33,9 +33,14 @@ export async function POST({ request, cookies } : RequestEvent) {
33
  },
34
  select: {
35
  instance_prompt: true,
 
36
  }
37
  })
38
 
 
 
 
 
39
  const response = await fetch(process.env.SECRET_INFERENCE_API_URL + "/models/" + generation?.model?.id, {
40
  method: "POST",
41
  headers: {
 
33
  },
34
  select: {
35
  instance_prompt: true,
36
+ base_model: true,
37
  }
38
  })
39
 
40
+ if (model?.base_model === "black-forest-labs/FLUX.1-dev") {
41
+ delete generation.negative_prompt
42
+ }
43
+
44
  const response = await fetch(process.env.SECRET_INFERENCE_API_URL + "/models/" + generation?.model?.id, {
45
  method: "POST",
46
  headers: {