Skip to content

Latest commit

 

History

History
210 lines (150 loc) · 17.1 KB

README_EN.md

File metadata and controls

210 lines (150 loc) · 17.1 KB

Semi-Auto-NovelAI-to-Pixiv

💬 Introduction

Chinese document: README.md

  • This is a magical project that achieves batch image generation, which NovelAI itself cannot accomplish!

  • It not only generates images but also integrates various practical functions into one super user interface!

  • If you encounter any issues during usage, please join the QQ group for consultation: 559063963

Tip

On that day, heavy rain poured, thunder roared, and the wind was noisy, as if the whole world was trembling for some unknown force.

Functions currently implemented by Cheese:

Feature Description Example Note
Tutorial Introduction and usage tutorial for this project image Please read carefully
Text-to-Image A user interface for NovelAI using Gradio, functionally identical to using the NovelAI website except for the interface image Generated images will be saved to the ./output/t2i folder
Random NSFW Image Generates a NSFW image randomly using tags from ./files/favorite.json, negative prompt words will be randomly chosen from the negative beliefs in favorite.json image For configuration of random NSFW images, please refer to the other parts of the WebUI configuration settings page
Random Image Infinitely generates images using prompts from *.txt files in ./file/prompt appended with user input, negative prompt words will be randomly chosen from the negative beliefs in favorite.json image For configuration of random images, please refer to the other parts of the WebUI configuration settings page
Vibe Functionally identical to using NovelAI website, added batch functionality image Prepare some images in the same folder, rename images to (any(not containing underscores))_(information extraction strength, float(0, 1))_(reference strength, float(0, 1)).png) format, e.g., hoshino-hinata_1.0_0.6, when selecting random NSFW, infinite generation will follow random NSFW mode, otherwise, infinite generation will follow random image mode
Image-to-Image Functionally identical to using NovelAI website, supports any image, added batch processing image Generated images will be saved to the ./output/i2i folder, a temporary image named temp.png will be generated in the ./output folder, can be deleted, for batch processing, place images in the same folder, e.g., ./output/choose_to_i2i
Partial Redraw Supports images generated by NovelAI, requires uploading a mask, supports batch operations image Uploaded mask should have redrawn areas in white, remaining areas transparent (not black), resolution should match the redrawn image, for batch operations, place images and masks in two separate folders with identical filenames, e.g., ./output/inpaint/img, ./output/inpaint/mask, generated images will be saved to ./output/inpaint
Video-to-Illustration Redraw the video in several steps to convert 3D into 2D image Experimental feature, suggestions are welcome
Chunk redraw Split a large image into 640x640 chunks, and then enlarge these chunks to 1024x1024 in the way of a diagram, I don't need to worry about the two images being too connected, I use the open source project in the credits list to fix the seams rife-ncnn-vulkan image Due to the long time required, only a single zoom is currently available, and you need to provide a picture or image path (choose one)
Super Resolution Denoising Utilizes open-source projects listed in the acknowledgments to perform super resolution denoising on images, supports single or batch processing image Generated images will be saved to the ./output/upscale folder, not recommended to use srmd-cuda due to instability, when using waifu2x-caffe or waifu2x-converter, a temporary batch file named temp.bat will be generated in the ./output folder, can be deleted, for batch processing, place images in the same folder, e.g., ./output/choose_to_upscale
Auto Mosaic Automatically detects key parts in images and mosaic them image Cannot guarantee 100% detection, generated images will be saved to the ./output/mosaic folder, for batch processing, place images in the same folder, e.g., ./output/choose_to_mosaic
Add Watermark Adds a specified number of random watermarks with random transparency at random positions (top-left, top-right, bottom-left, bottom-right) on images image Prepare your watermarks in ./files/water folder before usage. Enter the directory of images to be processed and click OK, processed images will be saved to the ./output/water folder
Upload to Pixiv Batch uploads images to Pixiv image For Pixiv upload configuration, please refer to other parts of the WebUI configuration settings page
Image Filtering Tool for manually filtering images image Enter the image directory and press OK, then input the output directory. A file named array_data.npy will be generated in the ./output folder, it saves the progress of the last filtering, so you can continue without selecting the image directory again, after filtering, it will be automatically deleted
Data Erasure Batch erases, restores, or exports image generation information image For restoration, prepare at least a *.png image with prompt or a *.txt file containing prompt, and place it in a directory (image information file directory), the filenames (without extension) in the selected directory to be restored need to be consistent with those in the image information file directory
Magic Analysis Reads png info using open-source projects listed in the acknowledgments image Embedded into this project via iframe
Tagger Utilizing the reverse inference model deployed on Hugging Face by SmilingWolf, I added batch operations to it image During batch processing, the generated prompt text will be saved to the same directory as the images
GPT Free Free, multi-model GPT, utilizing open-source projects listed in the acknowledgments image Embedded into this project via iframe
Plugin Store Show all plugins in the plugin list (./files/plugins.json) image When installing, copy and paste the name of the plug-in you want to install into the name in the upper left corner, click Install, and it will take effect after restarting
Configuration Settings Change configuration options in WebUI image Remember to save changes, takes effect immediately after restart

Learning Gradio, trying to create a WebUI for this project.

🔌 Plugins

  • Implementation of dynamically loading plugins to enhance the project's scalability!

  • Plugins submitted to the store: Plugin List

Tip

I walked alone on the slippery and muddy streets, with only a few street lamps blinking lonely in the dark night.

💿 Deployment

💻 Configuration Requirements

  • Extremely low configuration requirements for the ultimate user experience!
Item Description
NovelAI Membership To generate images infinitely, it is recommended to have a $25/month membership.
Network To successfully send POST requests, please make sure that you can access these website: novelai.net, huggingface.co, github.com
1GB VRAM At least 1GB of VRAM is required to use all engines for super-resolution denoising.
2GB RAM At least 2GB of RAM is required for smooth operation of this project.
Windows 10/11(x64) To use all features, a 64-bit version of Windows 10/11 is required.
Microsoft Visual C++ 2015 Installation of the runtime library is required to use all engines for super-resolution denoising.

Warning

In the distance, a few cat cries came, as if the only notes of the night, the darkness desolate, the biting cold wind, desolate and lonely.

🎉 Getting Started with Deployment

0️⃣ Star this project

  • If you enjoy this project, please consider giving it a Star🌟. It's the greatest motivation for the developers.

1️⃣ Install Python

  • I recommend installing Python 3.10.11. During installation, please ensure to check the option Add Python to PATH, and keep the rest as default.

2️⃣ Install Git

  • Suggested to install Latest Version, you just need to click Next button.

3️⃣ Clone Repositories

  • Open cmd or powershell, run git clone -b main --depth=1 https://github.com/zhulinyv/Semi-Auto-NovelAI-to-Pixiv.git

4️⃣ Next step

  • Now you can launch the run.bat at the origin directory to start WebUI, it will create the virtual environment and install the dependences at the first time, it will take a long time, so you can drink some coffe or read the documents below

Tip

Moonlight seeps through sparse clouds, casting its glow upon the ground, sketching out a scene of ethereal beauty.

⚙️ Configuration

  • ⚠️ 1. If you have started the WebUI but haven't performed necessary configurations, please navigate to the settings page for necessary configurations.

  • ⚠️ 2. Please do not skip this step, it's crucial. Make sure you have reviewed all configurations thoroughly.

  • ⚠️ 3. Alternatively, you can directly edit the .env file for configurations.

Warning

The cries of those cats, sometimes distant, sometimes drawing near, leaving uncertainty about the path ahead.

⚠️ Getting the token:

  • jc

⚠️ Getting pixiv_cookie and pixiv_token:

    1. Open https://www.pixiv.net/illustration/create and manually upload an image.
    1. Choose tags, age restrictions, AI-generated work, public range, comments on works, and original works.
    1. Press F12 to open the console and switch to the Network tab.
    1. Click on the submit button.
    1. Find and click on the 'illustraion' request, then switch to the Headers tab.
    1. In the request headers, you can find the Cookie and X-Csrf-Token.
  • 97ae3696ad11708ae2eb0474f198de0c

🌟 Usage

  • Run run.bat, it will automatically open the default browser and navigate to 127.0.0.1:11451

  • For old version users: It's no longer recommended to run individual scripts. Please use the WebUI.

  • If it's really necessary (for example, if the browser has added the sleep whitelist but cannot continue generating on an inactive page), please configure the directory and other parameters in the WebUI and click Generate Standalone Scripts (you can also read the source code to write standalone scripts by yourself), then run run_stand_alone_scripts.bat in the root directory.

  • For plugin development, please refer to: Wiki

Tip

Above is endless darkness, below is endless darkness, as if trapped in an endless vortex.

📖 To-Do

Tip

Darkness is like invisible hands, tightly embracing me, deeply devouring my thoughts.

  • Batch text-to-image generation
  • Batch image-to-image generation
  • Batch upload to Pixiv
  • Calculate remaining crystals
  • Batch waifu2x
  • Batch local redraw
  • Batch vibe
  • Batch mosaic
  • Write a WebUI using Gradio
  • Containerize the project for persistent running
  • Change the style of the interface
  • Add ChatGPT
  • White a picture selector
  • Get token by account and password
  • Add more upscale engine
  • Add more ways to t2i
  • Batch watermarking
  • Batch PNG info processing
  • Configuration item interface
  • Open related folders functionality
  • Merge interfaces such as random NSFW
  • Hotkey for quick image filtering
  • Tutorial and instruction pages
  • Custom plugins
  • Automatically generate standalone script
  • Specify the number of Text-to-Image outputs
  • Wensheng diagram seed click to switch randomly
  • Add whether to restore image information in the configuration item
  • Complete independent script generation
  • Picture save category
  • Support for non-literate diagram plugins
  • Video redrawing
  • Prompts inferr
  • Tile upscale
  • Add more interpolation engines
  • Translate the rest of the page
  • Auto updata
  • Plugins store
  • Custom eraser meta data
  • Auto install plugins
  • Proxy setting
  • Batch enhance
  • Custom save path
  • Learn the C# and write a luncher with wpfui
  • ...

🤝 Acknowledgements

This project uses waifu2x-ncnn-vulkan | Anime4KCPP | realcugan-ncnn-vulkan | realesrgan-ncnn-vulkan | realsr-ncnn-vulkan | srmd-cuda | srmd-ncnn-vulkan | waifu2x-caffe | waifu2x-converter for denoising and upscaling images.

This project uses stable-diffusion-inspector for parsing image metadata.

This project uses Genshin-Sync for uploading images to Pixiv.

This project uses GPT4FREE to provide GPT services.

This project uses novelai-image-metadata to eraser the metadata.

This project uses SmilingWolf/wd-tagger to inferr Prompts.

This project uses rife-ncnn-vulkan to process tile redrawing slice seams

Note

Falling, falling.


skirt.png