Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
56c93bc2
Unverified
Commit
56c93bc2
authored
Apr 21, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
Apr 21, 2024
Browse files
Merge branch 'dev' into litellm-as-subprocess
parents
f83eb732
7d4f9134
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
31 deletions
+30
-31
backend/apps/images/utils/comfyui.py
backend/apps/images/utils/comfyui.py
+2
-2
src/lib/components/chat/MessageInput.svelte
src/lib/components/chat/MessageInput.svelte
+22
-25
src/lib/components/layout/Sidebar/ArchivedChatsModal.svelte
src/lib/components/layout/Sidebar/ArchivedChatsModal.svelte
+6
-4
No files found.
backend/apps/images/utils/comfyui.py
View file @
56c93bc2
...
...
@@ -195,7 +195,7 @@ class ImageGenerationPayload(BaseModel):
def
comfyui_generate_image
(
model
:
str
,
payload
:
ImageGenerationPayload
,
client_id
,
base_url
):
host
=
base_url
.
replace
(
"http://"
,
""
).
replace
(
"https://"
,
""
)
ws_url
=
base_url
.
replace
(
"http://"
,
"
ws://
"
).
replace
(
"https://"
,
"
wss://
"
)
comfyui_prompt
=
json
.
loads
(
COMFYUI_DEFAULT_PROMPT
)
...
...
@@ -217,7 +217,7 @@ def comfyui_generate_image(
try
:
ws
=
websocket
.
WebSocket
()
ws
.
connect
(
f
"ws
://
{
host
}
/ws?clientId=
{
client_id
}
"
)
ws
.
connect
(
f
"
{
ws
_url
}
/ws?clientId=
{
client_id
}
"
)
log
.
info
(
"WebSocket connection established."
)
except
Exception
as
e
:
log
.
exception
(
f
"Failed to connect to WebSocket server:
{
e
}
"
)
...
...
src/lib/components/chat/MessageInput.svelte
View file @
56c93bc2
...
...
@@ -316,8 +316,13 @@
console.log(e);
if (e.dataTransfer?.files) {
let reader = new FileReader(
);
const inputFiles = Array.from(e.dataTransfer?.files
);
if (inputFiles && inputFiles.length > 0) {
inputFiles.forEach((file) => {
console.log(file, file.name.split('.').at(-1));
if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) {
let reader = new FileReader();
reader.onload = (event) => {
files = [
...files,
...
...
@@ -327,13 +332,6 @@
}
];
};
const inputFiles = Array.from(e.dataTransfer?.files);
if (inputFiles && inputFiles.length > 0) {
inputFiles.forEach((file) => {
console.log(file, file.name.split('.').at(-1));
if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) {
reader.readAsDataURL(file);
} else if (
SUPPORTED_FILE_TYPE.includes(file['type']) ||
...
...
@@ -470,6 +468,10 @@
hidden
multiple
on:change={async () => {
if (inputFiles && inputFiles.length > 0) {
const _inputFiles = Array.from(inputFiles);
_inputFiles.forEach((file) => {
if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) {
let reader = new FileReader();
reader.onload = (event) => {
files = [
...
...
@@ -482,11 +484,6 @@
inputFiles = null;
filesInputElement.value = '';
};
if (inputFiles && inputFiles.length > 0) {
const _inputFiles = Array.from(inputFiles);
_inputFiles.forEach((file) => {
if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) {
reader.readAsDataURL(file);
} else if (
SUPPORTED_FILE_TYPE.includes(file['type']) ||
...
...
src/lib/components/layout/Sidebar/ArchivedChatsModal.svelte
View file @
56c93bc2
...
...
@@ -67,7 +67,7 @@
<div class="flex flex-col md:flex-row w-full px-5 py-4 md:space-x-4 dark:text-gray-200">
<div class=" flex flex-col w-full sm:flex-row sm:justify-center sm:space-x-6">
{#if chats.length > 0}
<div class="text-left text-sm w-full mb-4">
<div class="text-left text-sm w-full mb-4
max-h-[22rem] overflow-y-scroll
">
<div class="relative overflow-x-auto">
<table class="w-full text-sm text-left text-gray-500 dark:text-gray-400 table-auto">
<thead
...
...
@@ -75,7 +75,7 @@
>
<tr>
<th scope="col" class="px-3 py-2"> {$i18n.t('Name')} </th>
<th scope="col" class="px-3 py-2"> {$i18n.t('Created At')} </th>
<th scope="col" class="px-3 py-2
hidden md:flex
"> {$i18n.t('Created At')} </th>
<th scope="col" class="px-3 py-2 text-right" />
</tr>
</thead>
...
...
@@ -93,8 +93,10 @@
</a>
</td>
<td class=" px-3 py-1">
<td class=" px-3 py-1 hidden md:flex h-[2.5rem]">
<div class="my-auto">
{dayjs(chat.created_at * 1000).format($i18n.t('MMMM DD, YYYY HH:mm'))}
</div>
</td>
<td class="px-3 py-1 text-right">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment