mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🖼️ fix: Resolve appConfig Access Before Initialization in Image Generation (#9366)
Co-authored-by: Olivier Schiavo <olivier.schiavo@wengo.com>
This commit is contained in:
parent
62315be197
commit
beabe38311
1 changed files with 1 additions and 1 deletions
|
|
@ -929,6 +929,7 @@ async function saveBase64Image(
|
||||||
url,
|
url,
|
||||||
{ req, file_id: _file_id, filename: _filename, endpoint, context, resolution },
|
{ req, file_id: _file_id, filename: _filename, endpoint, context, resolution },
|
||||||
) {
|
) {
|
||||||
|
const appConfig = req.config;
|
||||||
const effectiveResolution = resolution ?? appConfig.fileConfig?.imageGeneration ?? 'high';
|
const effectiveResolution = resolution ?? appConfig.fileConfig?.imageGeneration ?? 'high';
|
||||||
const file_id = _file_id ?? v4();
|
const file_id = _file_id ?? v4();
|
||||||
let filename = `${file_id}-${_filename}`;
|
let filename = `${file_id}-${_filename}`;
|
||||||
|
|
@ -943,7 +944,6 @@ async function saveBase64Image(
|
||||||
}
|
}
|
||||||
|
|
||||||
const image = await resizeImageBuffer(inputBuffer, effectiveResolution, endpoint);
|
const image = await resizeImageBuffer(inputBuffer, effectiveResolution, endpoint);
|
||||||
const appConfig = req.config;
|
|
||||||
const source = getFileStrategy(appConfig, { isImage: true });
|
const source = getFileStrategy(appConfig, { isImage: true });
|
||||||
const { saveBuffer } = getStrategyFunctions(source);
|
const { saveBuffer } = getStrategyFunctions(source);
|
||||||
const filepath = await saveBuffer({
|
const filepath = await saveBuffer({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue