e97715843bf47ab98229e096bafafb16dffa0c8a
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [x] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [x] Have you added type definitions?
# Description
This PR adds a new feature that allows users to add custom images to
character folders. Instead of uploading images directly, this feature
utilizes the existing image pool from **the global module**. Users can
either select from existing images in the global module or upload new
images to the module.
The users can use a context menu on a folder to update its image.
## Why Use the Global Module?
The global module was chosen for several reasons:
1. It allows the reuse of existing functions and code, minimizing the
need for new implementations.
2. Users can easily select existing images without re-uploading them.
3. The global module provides reliable support for image upload and
deletion.
4. Images uploaded via the global module are accessible across all
platforms where the shared data is available.
## Note
To retrieve the list of assets from the global module, I used the
following code:
```typescript
let assetPaths: { [key: string]: { path: string } } = {};
const moduleAssets = getModuleAssets();
if (moduleAssets.length > 0) {
for (const asset of moduleAssets) {
const assetPath = await getFileSrc(asset[1]);
assetPaths[asset[0].toLocaleLowerCase()] = {
path: assetPath,
};
}
}
```
I reused the `parseAdditionalAssets` code from
`/src/ts/parser.svelte.ts` because it seemed simple and practical for
this feature. I thought about refactoring it into a shared function but
decided to keep it simple for now. I’m not sure if this is the best
approach, but it can always be changed later if needed.
---
If you are already working on a similar feature, find any issues with
this code, or feel this PR does not align with the project's direction,
I fully understand if this PR is not accepted.
Thank you!
---
One last note: With *transparent background images* and the existing
folder color functionality, users can differentiate categories even when
using the same image by applying different colors!
RisuAI
RisuAI, or Risu for short, is a cross platform AI chatting software / web application with powerful features such as multiple API support, assets in the chat, regex functions and much more.
Screenshots
| Screenshot 1 | Screenshot 2 |
|---|---|
Features
- Multiple API Supports: Supports OAI, Claude, Ooba, OpenRouter... and More!
- Emotion Images: Display the image of the current character, according to his/her expressions!
- Group Chats: Multiple characters in one chat.
- Plugins: Add your features and providers, and simply share.
- Regex Script: Modify model's output by regex, to make a custom GUI and others
- Powerful Translators: Automatically translate the input/output, so you can roleplay without knowing model's language.
- Lorebook: Also known as world infos or memory book, which can make character memorize more.
- Themes: Choose it from 3 themes, Classic, WaifuLike, WaifuCut.
- Powerful Prompting: Change the prompting order easily, Impersonate inside prompts, Use conditions, variables... and more!
- Customizable, Friendly UI: Great Accessibility and mobile friendly
- TTS: Use TTS to make the output text into voice.
- Additonal Assets: Embed your images, audios and videos to bot, and make it display at chat or background!
- And More!
You can get detailed information on https://github.com/kwaroran/RisuAI/wiki (Work in Progress)
Discord
Installation
- RisuAI Website (Recommended)
- Github Releases
Docker Installation
You can also run RisuAI using Docker. This method is particularly useful for web hosting.
-
Clone the repository:
git clone https://github.com/kwaroran/RisuAI.git cd RisuAI -
Build and run the Docker container:
docker-compose up -d -
Access RisuAI at
http://localhost:6001in your web browser.
Description
Languages
TypeScript
58.9%
Svelte
35.1%
JavaScript
4.4%
Rust
0.5%
Lua
0.3%
Other
0.7%