Update lollms_tti.js

This commit is contained in:
Saifeddine ALOUI 2024-09-30 11:56:21 +02:00 committed by GitHub
parent d10cdf31c6
commit fc92830006
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,7 +6,12 @@ class LollmsTTI {
setBaseUrl(baseUrl){
this.baseUrl = baseUrl;
}
updateSettings(settings) {
// Update each setting if it's provided in the settings object
if ('host_address' in settings) this.baseUrl = settings.host_address;
if ('baseUrl' in settings) this.baseUrl = settings.baseUrl;
}
async generateImage(prompt, negativePrompt = '', width = 512, height = 512) {
const url = `${this.baseUrl}/generate_image`;
const requestBody = {