Stable Diffusion on Mac

Generating Anime Images with Stable Diffusion: Implementing Counterfeit-V3.0 and VAEs

Choosing the right model is crucial when generating anime images using Stable Diffusion. This guide explains how to install the "Counterfeit-V3.0" model, add a VAE (Variational Autoencoder) file, and incorporate "R-ESRGAN 4x+ Anime6B" for image upscaling (increasing resolution).

Step 1: Downloading Counterfeit-V3.0

First, download the model from Civitai or Hugging Face. "Counterfeit-V3.0" is a large file (approximately 3.95GB), so the download may take some time.

After downloading, place it in the stable-diffusion-webui/models/Stable-diffusion/ folder.

Step 2: Adding the VAE File

Next, install a VAE file to improve image generation accuracy. Using a VAE file enhances image sharpness and color representation, resulting in higher-quality anime images.

Placing the VAE File

  1. Place the downloaded VAE file (klF8Anime2VAE.safetensors) in the stable-diffusion-webui/models/VAE/ folder.
  2. Open the WebUI and configure the settings.

WebUI Configuration

  1. Open the Settings screen in the WebUI.
  2. In the "VAE" section, select the desired VAE model (e.g., klF8Anime2VAE_klF8Anime2VAE.safetensors) from the "SD VAE" dropdown menu.
  3. Click "Apply settings" at the bottom of the screen to save the changes.
  4. Restart the WebUI to apply the new VAE settings.

Step 3: Downloading and Placing EasyNegativeV2.safetensors

To further improve image generation, you can use "EasyNegativeV2.safetensors." This file helps refine the negative aspects of the image, leading to more aesthetically pleasing results.

After downloading, place the "EasyNegativeV2.safetensors" file in the stable-diffusion-webui/embeddings/ folder.

Step 4: Installing R-ESRGAN 4x+ Anime6B (Image Upscaling)

To upscale (increase the resolution of) images generated by Stable Diffusion, install the "R-ESRGAN 4x+ Anime6B" model.

Downloading and Placing R-ESRGAN 4x+ Anime6B

  1. Navigate to the stable-diffusion-webui/models/ESRGAN/ folder.
  2. Execute the following command to download the model:
cd stable-diffusion-webui/models/ESRGAN/
curl -LO https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesrgan-x4plus-anime6b.pth

Once the download is complete, the upscaling function will be available in the WebUI's "Extras" tab.

Step 5: Launching Stable Diffusion

After placing these files in their respective folders, launch the Stable Diffusion WebUI. Use the following command to launch on an Apple Silicon Mac:

./webui.sh --precision full --no-half --use-cpu=all --skip-torch-cuda-test
  • --precision full: Uses full precision.
  • --no-half: Disables half precision.
  • --use-cpu=all: Runs all processes on the CPU.
  • --skip-torch-cuda-test: Skips the CUDA test.

Step 6: Creating Prompts

To generate anime-style images with Stable Diffusion, it is essential to use appropriate prompts (input text).

  • Prompt Example 1: A girl with long white hair sitting in a flower field
(masterpiece, best quality), 1 girl with long white hair sitting in a field of green plants and flowers, her hand under her chin, warm lighting, white dress, blurry foreground
A girl sitting in a field of flowers

  • Prompt Example 2: A girl in a school uniform under a blue sky
(masterpiece, best quality), 1girl, solo, flower, long hair, outdoors, letterboxed, school uniform, day, sky, looking up, short sleeves, parted lips, shirt, cloud, black hair, sunlight, white shirt, serafuku, upper body, from side, pink flower, blurry, brown hair, blue sky, depth of field
A girl in a school uniform under a blue sky

  • Prompt Example 3: A girl in a city with buildings and sky
sky, cloud, 1girl, building, outdoors, city, long hair, cloudy sky, starry sky, sunlight, skirt, brown hair, <lora:onelastlastcogecha:1>, masterpiece, best quality
A girl in a city with buildings and sky

Summary

By installing "Counterfeit-V3.0," a VAE file, "EasyNegativeV2.safetensors," and "R-ESRGAN 4x+ Anime6B," you can generate higher-quality anime-style images. Use these instructions to create your own original art!