From 70526990a112c1de9a3a6a912939a2a7ce66849f Mon Sep 17 00:00:00 2001 From: newtextdoc1111 Date: Sun, 11 May 2025 18:30:19 +0900 Subject: [PATCH] chore: Translate README into English --- README.md | 120 +++++++++++++++++++++++++++++++++++++++++++++- docs/README_jp.md | 23 ++++----- 2 files changed, 131 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 006706f..48b961c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,125 @@ ## English • [日本語](docs/README_jp.md) -**⚠ English translation in progress.** +![ss01](https://github.com/user-attachments/assets/bb139951-ad78-4d87-b290-97aafa1221d7) + +> [!WARNING] +> This custom node is currently in beta. Features may change or bugs may occur without notice. + +## Overview + +**ComfyUI-Autocomplete-Plus** is a custom node that provides multiple input assistance features for any text area in [ComfyUI](https://github.com/comfyanonymous/ComfyUI). Currently, it mainly supports Danbooru-style tag input. + +## Features + +- **:zap:No setup required**: Automatically downloads CSV data optimized for Danbooru tags. +- **:mag:Autocomplete**: Displays tag suggestions in real-time based on your input as you type. +- **:file_cabinet:Related Tags Display**: Shows a list of tags highly related to the selected tag. +- **:earth_asia:Multilingual Support**: Supports input completion in Japanese, Chinese, and Korean. +- **:computer_mouse:Intuitive Operation**: + - Supports both mouse and keyboard operations. + - Natural tag insertion that considers cursor position and existing text. +- **:art:Design**: Supports both light and dark themes of ComfyUI. +- **:pencil:User CSV**: Allows users to add their own CSV files for autocomplete suggestions. +- **Zero Dependencies**: All input assistance processing works in the browser without external libraries. + +## Installation + +For the beta version, you can install it using the following steps: +1. Clone or copy this repository into the `custom_nodes` folder of ComfyUI. + `git clone https://github.com/newtextdoc1111/ComfyUI-Autocomplete-Plus.git` +2. Launch ComfyUI. The necessary CSV data will be automatically downloaded from HuggingFace on the first launch only. + +## Autocomplete + +When you type in a text input area, tags that partially match the text are displayed in descending order of post count. You can select a tag with the up and down keys, and insert the selected tag by pressing Enter or Tab. + +- Tag aliases are also included in the search. Japanese hiragana and katakana are searched without distinction. +- Tags are color-coded by category. The color-coding rules are the same as Danbooru. +- Existing tags are displayed in gray. If a grayed-out tag is confirmed, the existing tag will be selected instead. + +## Related Tags + +![ss02](https://github.com/user-attachments/assets/854571cd-01eb-4e92-a118-2303bec0b175) + +When you select any tag in a text input area, highly related tags list are displayed. The UI's position and size are automatically adjusted based on the text area being edited. + +- The display position is primarily at the bottom of the text area and automatically adjusts vertically based on available space. + - You can switch between vertical and horizontal display positions using the "↕️|↔️" button in the header. +- You can toggle the pinned state of the displayed related tags using the "📌|🎯" button in the header. To close the UI when pinned, press the Esc key. +- You can display related tags for the cursor position by pressing `Ctrl+Shift+Space`. + +## CSV Data + +Two basic CSV data files are required for operation. These are managed on [HuggingFace](https://huggingface.co/datasets/newtextdoc1111/danbooru-tag-csv) and are automatically downloaded when ComfyUI is first launched after installation, so no setup is required. +Since the basic CSV files are based on the Danbooru dataset publicly available on HuggingFace, the post counts and related tag information may differ from the Danbooru website. + +> [!IMPORTANT] +> The basic CSV contains both SFW and NSFW tags. + +**danbooru_tags.csv** + +This is a tag information CSV file for autocomplete, containing tag names, categories, post counts, and aliases (including Japanese, Chinese, and Korean). The column structure is the same as that used in [DominikDoom/a1111-sd-webui-tagcomplete](https://github.com/DominikDoom/a1111-sd-webui-tagcomplete). + +Tag information is filtered under the following conditions: +- Post count of 100 or more +- Image score of 5 or more +- Category is `general, character, or copyright` +- Tag name does not contain `(cosplay)` + +**danbooru_tags_cooccurrence.csv** + +This is a CSV file for related tag calculation, recording tag pairs and their co-occurrence counts. + +Tag pairs are further filtered from the tag information CSV under the following conditions: +- Co-occurrence count of 100 or more + +### User CSV + +Users can also use their own CSV files. For example, frequently used meta tags can be added to the autocomplete suggestions by placing a file named `danbooru_tags_meta.csv` in the `data` folder. +A header row is not required. A browser reload is necessary to apply the changes. + +**Example of meta tags:** +```csv +tag,category,count,alias +masterpiece,5,9999999, +best_quality,5,9999999, +high_quality,5,9999999, +normal_quality,5,9999999, +low_quality,5,9999999, +worst_quality,5,9999999, +``` + +>[!NOTE] +> If there are multiple user CSV files, they are loaded in alphabetical order. If the same tag exists in multiple files, the one loaded first is retained. The basic CSV is loaded last. + +## Settings + +### Autocomplete + +- **Enable Autocomplete**: Enable/disable the autocomplete feature. +- **Max suggestions**: Maximum number of autocomplete suggestions to display. + +### Related Tags + +- **Enable Related Tags**: Enable/disable the related tags feature. +- **Max related tags**: Maximum number of related tags to display. +- **Default Display Position**: Default display position when ComfyUI starts. +- **Related Tags Trigger Mode**: Trigger for displaying related tags (click, Ctrl+click). + + +## Known Issues + +### General + +- Due to the large size of the CSV files, browser startup time may be longer. +- It consumes memory to operate quickly in the browser. This should not be an issue on machines with specs capable of running ComfyUI. + +### Autocomplete + +### Related Tags +- When the UI is pinned, some keys other than specific ones may be entered into the text area during keyboard input. + ## Credits diff --git a/docs/README_jp.md b/docs/README_jp.md index f27bebe..a8d24be 100644 --- a/docs/README_jp.md +++ b/docs/README_jp.md @@ -11,7 +11,7 @@ ## 特徴 -- **:zap:セットアップ不要**: Danbooruタグに最適化されたCSVデータを自動でダウンロード +- **:zap:セットアップ不要**: Danbooruタグに最適化された CSV データを自動でダウンロード - **:mag:オートコンプリート**: テキスト入力中に、入力内容に基づいてタグ候補をリアルタイムで表示 - **:file_cabinet:関連タグ表示機能**: 選択したタグと関連性の高いタグを一覧表示 - **:earth_asia:多言語対応**: 日本語、中国語、韓国語での入力補完をサポート @@ -19,7 +19,7 @@ - マウスとキーボードどちらの操作にも対応 - カーソル位置や既存のテキストを考慮した自然なタグ挿入 - **:art:デザイン**: ComfyUIのライトテーマとダークテーマの両方に対応 -- **:pencil:ユーザーCSV**: ユーザーが用意したCSVをオートコンプリート候補に追加可能 +- **:pencil:ユーザーCSV**: ユーザーが用意した CSV をオートコンプリート候補に追加可能 - **依存ライブラリゼロ**: 外部ライブラリを使用せず、すべての入力支援処理がブラウザで動作 ## インストール @@ -31,16 +31,17 @@ ## オートコンプリート -テキスト入力エリアで文字を入力すると、テキストに部分一致するタグを投稿数の多い順で表示します。EnterかTabキーで選択したタグを挿入できます。 +テキスト入力エリアで文字を入力すると、テキストに部分一致するタグを投稿数の多い順で表示します。上下キーで選択、EnterかTabキーで選択したタグを挿入できます。 - タグのエイリアスも検索対象に含まれます。日本語のひらがな、カタカナは区別せず検索されます - タグのカテゴリ毎に色分けされます。色分けのルールは Danbooru と同じです +- 入力済みのタグはグレーアウトで表示されます。グレーアウトしたタグを確定した場合、代わりに入力済みのタグを選択状態にします ## 関連タグ ![ss02](https://github.com/user-attachments/assets/854571cd-01eb-4e92-a118-2303bec0b175) -テキスト入力エリアの任意のタグを選択すると、関連性の高いタグを表示します。UIは編集中のテキストエリアを基準に位置とサイズが自動で調整されます。 +テキスト入力エリアの任意のタグを選択すると、関連性の高いタグを一覧表示します。UIは編集中のテキストエリアを基準に位置とサイズが自動で調整されます。 - 表示位置は、テキストエリアの下部を基本とし、空きスペースに応じて上下に自動調整されます - ヘッダーの「↕️|↔️」ボタンで上下と左右の表示位置に切り替えられます @@ -49,11 +50,11 @@ ## CSV データ -動作には基本となるCSVデータが2つ必要です。これらは [HuggingFace](https://huggingface.co/datasets/newtextdoc1111/danbooru-tag-csv) で管理されており、 ComfyUI にインストール後の初回起動時に自動でダウンロードされます。 -基本CSVファイルはHuggingFaceで公開されているDanbooruデータセットを元にしているので、Danbooruサイトの投稿数や関連タグの情報と異なる場合があります。 +動作には基本となる CSV データが2つ必要です。これらは [HuggingFace](https://huggingface.co/datasets/newtextdoc1111/danbooru-tag-csv) で管理されており、 ComfyUI にインストール後の初回起動時に自動でダウンロードされるのでセットアップは不要です。 +基本 CSV ファイルはHuggingFaceで公開されているDanbooruデータセットを元にしているので、Danbooruサイトの投稿数や関連タグの情報と異なる場合があります。 > [!IMPORTANT] -> 基本CSVにはSFW, NSFW両方のタグが含まれています。 +> 基本 CSV にはSFW, NSFW両方のタグが含まれています。 **danbooru_tags.csv** @@ -67,7 +68,7 @@ **danbooru_tags_cooccurrence.** -タグペアとその共起回数を記録した、関連タグ計算用のCSVファイルです。 +タグペアとその共起回数を記録した、関連タグ計算用の CSV ファイルです。 タグペアはタグ情報 CSV から、さらに以下の条件でフィルタリングされています。 - 共起回数が100件以上 @@ -89,7 +90,7 @@ worst_quality,5,9999999, ``` >[!NOTE] -> ユーザーCSVが複数ある場合アルファベット順に読み込まれます。同じタグが複数のファイルに存在する場合は先に読み込まれた方が保持されます。基本CSVは最後にロードされます。 +> ユーザー CSV が複数ある場合アルファベット順に読み込まれます。同じタグが複数のファイルに存在する場合は先に読み込まれた方が保持されます。基本 CSV は最後にロードされます。 ## 設定 @@ -110,7 +111,7 @@ worst_quality,5,9999999, ### 全般 -- CSVファイルの容量が大きいため、ブラウザの起動時間が長くなる場合があります +- CSV ファイルの容量が大きいため、ブラウザの起動時間が長くなる場合があります - ブラウザ上で高速に動作させるためにメモリを消費します。ComfyUIが動作するスペックのマシンであれば問題にはならないと思います ### オートコンプリート @@ -124,4 +125,4 @@ worst_quality,5,9999999, - [ComfyUI-Custom-Node](https://github.com/pythongosssss/ComfyUI-Custom-Scripts) - オートコンプリート機能の実装にあたり参考にしました - [DominikDoom/a1111-sd-webui-tagcomplete](https://github.com/DominikDoom/a1111-sd-webui-tagcomplete) - - オートコンプリートの主要な機能やCSVの仕様で参考にしました + - オートコンプリートの主要な機能や CSV の仕様で参考にしました