mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 10:20:15 +01:00
refactor(StableDiffusion.js): update prompt and negative_prompt schema descriptions to include minimum number of keywords
fix(StableDiffusion.js): fix output path for generated image feat(askGPTPlugins.js): update import path for validateTools function
This commit is contained in:
parent
bffa9ad016
commit
7541e9b3d3
3 changed files with 7 additions and 6 deletions
|
|
@ -20,8 +20,8 @@ Guidelines:
|
|||
"negative_prompt":"semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime, out of frame, low quality, ugly, mutation, deformed"
|
||||
- Generate images only once per human query unless explicitly requested by the user`;
|
||||
this.schema = z.object({
|
||||
prompt: z.string().describe("Detailed keywords to describe the subject, separated by comma"),
|
||||
negative_prompt: z.string().describe("Keywords we want to exclude from the final image")
|
||||
prompt: z.string().describe("Detailed keywords to describe the subject, use at minimum but not limited to 5, separated by comma"),
|
||||
negative_prompt: z.string().describe("Keywords we want to exclude from the final image, use at minimum but not limited to 5, separated by comma")
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -42,8 +42,9 @@ Guidelines:
|
|||
return url;
|
||||
}
|
||||
|
||||
async _call(prompt, negative_prompt) {
|
||||
async _call(data) {
|
||||
const url = this.url;
|
||||
const { prompt, negative_prompt } = data;
|
||||
const payload = {
|
||||
prompt,
|
||||
negative_prompt,
|
||||
|
|
@ -57,8 +58,8 @@ Guidelines:
|
|||
|
||||
// Generate unique name
|
||||
const imageName = `${Date.now()}.png`;
|
||||
this.outputPath = path.resolve(__dirname, '..', '..', '..', '..', 'client', 'public', 'images');
|
||||
const appRoot = path.resolve(__dirname, '..', '..', '..', '..', 'client');
|
||||
this.outputPath = path.resolve(__dirname, '..', '..', '..', '..', '..', 'client', 'public', 'images');
|
||||
const appRoot = path.resolve(__dirname, '..', '..', '..', '..', '..', 'client');
|
||||
this.relativeImageUrl = path.relative(appRoot, this.outputPath);
|
||||
|
||||
// Check if directory exists, if not create it
|
||||
|
|
|
|||
BIN
api/client/public/images/1686764042034.png
Normal file
BIN
api/client/public/images/1686764042034.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 628 KiB |
|
|
@ -3,7 +3,7 @@ const router = express.Router();
|
|||
const { titleConvo } = require('../../../app/');
|
||||
// const { getOpenAIModels } = require('../endpoints');
|
||||
const ChatAgent = require('../../../app/langchain/ChatAgent');
|
||||
const { validateTools } = require('../../../app/langchain/tools');
|
||||
const { validateTools } = require('../../../app/langchain/tools/util');
|
||||
const { saveMessage, getConvoTitle, saveConvo, getConvo } = require('../../../models');
|
||||
const {
|
||||
handleError,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue