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
a937f650
"backend/apps/vscode:/vscode.git/clone" did not exist on "710850e442f98d5308d36cb8cd3a5556a41a8a46"
Commit
a937f650
authored
May 20, 2024
by
Jun Siang Cheah
Browse files
feat: add image gen with automatic1111 to integration test
parent
009e85d5
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
2 deletions
+60
-2
.github/workflows/integration-test.yml
.github/workflows/integration-test.yml
+5
-1
cypress/e2e/chat.cy.ts
cypress/e2e/chat.cy.ts
+23
-0
docker-compose.a1111-test.yaml
docker-compose.a1111-test.yaml
+31
-0
src/lib/components/common/Image.svelte
src/lib/components/common/Image.svelte
+1
-1
test/test_files/image_gen/sd-empty.pt
test/test_files/image_gen/sd-empty.pt
+0
-0
No files found.
.github/workflows/integration-test.yml
View file @
a937f650
...
@@ -20,7 +20,11 @@ jobs:
...
@@ -20,7 +20,11 @@ jobs:
-
name
:
Build and run Compose Stack
-
name
:
Build and run Compose Stack
run
:
|
run
:
|
docker compose --file docker-compose.yaml --file docker-compose.api.yaml up --detach --build
docker compose \
--file docker-compose.yaml \
--file docker-compose.api.yaml \
--file docker-compose.a1111-test.yaml \
up --detach --build
-
name
:
Wait for Ollama to be up
-
name
:
Wait for Ollama to be up
timeout-minutes
:
5
timeout-minutes
:
5
...
...
cypress/e2e/chat.cy.ts
View file @
a937f650
...
@@ -74,5 +74,28 @@ describe('Settings', () => {
...
@@ -74,5 +74,28 @@ describe('Settings', () => {
expect
(
spy
).
to
.
be
.
callCount
(
2
);
expect
(
spy
).
to
.
be
.
callCount
(
2
);
});
});
});
});
it
(
'
user can generate image
'
,
()
=>
{
// Click on the model selector
cy
.
get
(
'
button[aria-label="Select a model"]
'
).
click
();
// Select the first model
cy
.
get
(
'
button[aria-label="model-item"]
'
).
first
().
click
();
// Type a message
cy
.
get
(
'
#chat-textarea
'
).
type
(
'
Hi, what can you do? A single sentence only please.
'
,
{
force
:
true
});
// Send the message
cy
.
get
(
'
button[type="submit"]
'
).
click
();
// User's message should be visible
cy
.
get
(
'
.chat-user
'
).
should
(
'
exist
'
);
// Wait for the response
cy
.
get
(
'
.chat-assistant
'
,
{
timeout
:
120
_000
})
// .chat-assistant is created after the first token is received
.
find
(
'
div[aria-label="Generation Info"]
'
,
{
timeout
:
120
_000
})
// Generation Info is created after the stop token is received
.
should
(
'
exist
'
);
// Click on the generate image button
cy
.
get
(
'
[aria-label="Generate Image"]
'
).
click
();
// Wait for image to be visible
cy
.
get
(
'
img[data-cy="image"]
'
,
{
timeout
:
60
_000
}).
should
(
'
be.visible
'
);
});
});
});
});
});
docker-compose.a1111-test.yaml
0 → 100644
View file @
a937f650
# This is an overlay that spins up stable-diffusion-webui for integration testing
# This is not designed to be used in production
services
:
stable-diffusion-webui
:
# Not built for ARM64
platform
:
linux/amd64
image
:
ghcr.io/neggles/sd-webui-docker:latest
restart
:
unless-stopped
environment
:
CLI_ARGS
:
"
--api
--use-cpu
all
--precision
full
--no-half
--skip-torch-cuda-test
--ckpt
/empty.pt
--do-not-download-clip
--disable-nan-check
--disable-opt-split-attention"
PYTHONUNBUFFERED
:
"
1"
TERM
:
"
vt100"
SD_WEBUI_VARIANT
:
"
default"
# Hack to get container working on Apple Silicon
# Rosetta creates a conflict ${HOME}/.cache folder
entrypoint
:
/bin/bash
command
:
-
-c
-
|
export HOME=/root-home
rm -rf $${HOME}/.cache
/docker/entrypoint.sh python -u webui.py --listen --port $${WEBUI_PORT} --skip-version-check $${CLI_ARGS}
volumes
:
-
./test/test_files/image_gen/sd-empty.pt:/empty.pt
open-webui
:
environment
:
ENABLE_IMAGE_GENERATION
:
"
true"
AUTOMATIC1111_BASE_URL
:
http://stable-diffusion-webui:7860
IMAGE_SIZE
:
"
64x64"
IMAGE_STEPS
:
"
3"
src/lib/components/common/Image.svelte
View file @
a937f650
...
@@ -19,5 +19,5 @@
...
@@ -19,5 +19,5 @@
showImagePreview = true;
showImagePreview = true;
}}
}}
>
>
<img src={_src} {alt} class=" max-h-96 rounded-lg" draggable="false" />
<img src={_src} {alt} class=" max-h-96 rounded-lg" draggable="false"
data-cy="image"
/>
</button>
</button>
test/test_files/image_gen/sd-empty.pt
0 → 100644
View file @
a937f650
File added
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