Liam Dyer commited on
Commit
f6440ab
·
unverified ·
1 Parent(s): b58a549

feat: request model be concise on tool image outputs (#1202)

Browse files
src/lib/server/tools/images/editing.ts CHANGED
@@ -84,7 +84,7 @@ const imageEditing: BackendTool = {
84
  return {
85
  outputs: [
86
  {
87
- imageEditing: `An image has been generated for the following prompt: "${prompt}". Answer as if the user can already see the image. Do not try to insert the image or to add space for it. The user can already see the image. Do not try to describe the image as you the model cannot see it.`,
88
  },
89
  ],
90
  display: false,
 
84
  return {
85
  outputs: [
86
  {
87
+ imageEditing: `An image has been generated for the following prompt: "${prompt}". Answer as if the user can already see the image. Do not try to insert the image or to add space for it. The user can already see the image. Do not try to describe the image as you the model cannot see it. Be concise.`,
88
  },
89
  ],
90
  display: false,
src/lib/server/tools/images/generation.ts CHANGED
@@ -43,7 +43,7 @@ const imageGeneration: BackendTool = {
43
  default: 1024,
44
  },
45
  },
46
- async *call({ prompt, numberOfImages }, { conv, ip, username }) {
47
  const ipToken = await getIpToken(ip, username);
48
 
49
  const outputs = await callSpace<ImageGenerationInput, ImageGenerationOutput>(
@@ -51,8 +51,8 @@ const imageGeneration: BackendTool = {
51
  "/process_image",
52
  [
53
  Number(numberOfImages), // number (numeric value between 1 and 8) in 'Number of Images' Slider component
54
- 512, // number in 'Image Height' Number component
55
- 512, // number in 'Image Width' Number component
56
  String(prompt), // prompt
57
  Math.floor(Math.random() * 1000), // seed random
58
  ],
@@ -82,7 +82,7 @@ const imageGeneration: BackendTool = {
82
  return {
83
  outputs: [
84
  {
85
- imageGeneration: `An image has been generated for the following prompt: "${prompt}". Answer as if the user can already see the image. Do not try to insert the image or to add space for it. The user can already see the image. Do not try to describe the image as you the model cannot see it.`,
86
  },
87
  ],
88
  display: false,
 
43
  default: 1024,
44
  },
45
  },
46
+ async *call({ prompt, numberOfImages, width, height }, { conv, ip, username }) {
47
  const ipToken = await getIpToken(ip, username);
48
 
49
  const outputs = await callSpace<ImageGenerationInput, ImageGenerationOutput>(
 
51
  "/process_image",
52
  [
53
  Number(numberOfImages), // number (numeric value between 1 and 8) in 'Number of Images' Slider component
54
+ Number(height), // number in 'Image Height' Number component
55
+ Number(width), // number in 'Image Width' Number component
56
  String(prompt), // prompt
57
  Math.floor(Math.random() * 1000), // seed random
58
  ],
 
82
  return {
83
  outputs: [
84
  {
85
+ imageGeneration: `An image has been generated for the following prompt: "${prompt}". Answer as if the user can already see the image. Do not try to insert the image or to add space for it. The user can already see the image. Do not try to describe the image as you the model cannot see it. Be concise.`,
86
  },
87
  ],
88
  display: false,