-
Quick and dirty fork to enable lobe-chat to send ComfyUI api request + receive image link.
-
Secondary : Allow to have custom background image based on session id, just use a .png with session id name, from your url. (public/Bjornulf_backgrounds/16a174d5-928f-42e0-b1a7-3bb329a1bfa2.png) -Require restart to take effect-
Tested with Node v21.7.0, bun 1.0.30. (So you can nvm install v21.7.0
for example, and curl -fsSL https://bun.sh/install | bash -s "bun-v1.0.30"
)
git clone https://github.com/justUmen/Bjornulf_lobe-chat
cd Bjornulf_lobe-chat
bun install
bun run build
bun run start
And the server will be running on http://localhost:3210
, use the browser of your choice.
- Need to use my Comfyui custom nodes : https://github.com/justUmen/ComfyUI-BjornulfNodes
- Can use my JSON workflows in the
public/Bjornulf_API/
folder to send to the ComfyUI, like for examplesd15.json
(Warning : You need to launch it manually at least one time before using it in lobe-chat. - It is using a link
output/BJORNULF_API_LAST_IMAGE.png
created by my custom node comfyui, that need to be used in the workflow. The generated image is then copied using this link to thepublic/generated/
folder inside lobe-chat.
- If used with LLM, it also sends the local image link as useless tokens. (Not a huge waste, but a waste nevertheless.)
Lobechat is using by default storage in browser, but you can use a database to store the chat history. Here is a quick guide to use PostgreSQL : - You can also use the docker but I don't.-
sudo apt install postgresql
psql -U postgres
OR
sudo -i -u postgres
psql
CREATE DATABASE lobe_chat_db;
CREATE USER youruser WITH PASSWORD 'yourpassword';
GRANT ALL PRIVILEGES ON DATABASE lobe_chat_db TO youruser;
\c lobe_chat_db
GRANT USAGE, CREATE ON SCHEMA public TO youruser;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO youruser;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO youruser;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO youruser;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO youruser;
\q
NEXT_PUBLIC_SERVICE_MODE=server
DATABASE_DRIVER=node
DATABASE_URL=postgres://youruser:yourpassword@localhost:5432/lobe_chat_db
KEY_VAULTS_SECRET=MgMzt2U+lKwSCN9enMYmyvVRTFzsb60db8127035
NEXT_AUTH_SECRET=RDD/HFZTSufylb61eb1117095t3KuO1FrHnviMATqAa=
NEXT_AUTH_SSO_PROVIDERS=github
GITHUB_CLIENT_ID=Iw23lx1kdsIoieHxufr
GITHUB_CLIENT_SECRET=25b7fff7a065b6c63e2e5d19c7adb60db1217075
ACCESS_CODE=thispasswordisverylong
-
Generate KEY_VAULTS_SECRET and NEXT_AUTH_SECRET with
openssl rand -base64 32
. -
GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET are obtained by creating a new OAuth App on GitHub.
You can use http://localhost:3210 as the homepage URL and the Authorization callback URL.
Link Tutorial : ssoproviders/github