Logo for AiToolGo

Civitai Companion: Streamlining AI Image Workflow with Automated Metadata Extraction and Resource Management

In-depth discussion
Technical
 0
 0
 31
Logo for Civitai

Civitai

Civitai

Civitai Companion is a Python utility designed to extract prompt metadata from Civitai AI images, automatically download the resources used to generate them, and output the prompt information in a user-defined format. It features batch processing, resource filtering, and template customization for compatibility with various AI image generation tools like Dream Factory and Automatic1111.
  • main points
  • unique insights
  • practical applications
  • key topics
  • key insights
  • learning outcomes
  • main points

    • 1
      Batch extracts prompts and metadata from Civitai images.
    • 2
      Automatically downloads required resources (models, LoRAs, embeddings).
    • 3
      Outputs prompt information in user-defined formats using templates.
    • 4
      Provides advanced features like LoRA path modification, prompt filtering, and image resizing.
  • unique insights

    • 1
      The tool automatically translates unsupported sampler names into compatible ones for Automatic1111.
    • 2
      It allows blacklisting resources to prevent unwanted downloads.
  • practical applications

    • Civitai Companion streamlines the process of re-creating images from Civitai by automating resource retrieval and prompt formatting, making it easier for users to experiment with different settings and generate similar images.
  • key topics

    • 1
      Prompt Extraction
    • 2
      Resource Downloading
    • 3
      Template Customization
    • 4
      AI Image Generation
    • 5
      Civitai
    • 6
      Dream Factory
    • 7
      Automatic1111
  • key insights

    • 1
      Automated resource download based on prompt metadata.
    • 2
      Flexible template system for outputting prompt information.
    • 3
      Support for multiple AI image generation tools.
    • 4
      Advanced features for customization and optimization.
  • learning outcomes

    • 1
      Understand the core functionalities of Civitai Companion.
    • 2
      Learn how to set up and use the tool effectively.
    • 3
      Explore advanced features and customization options.
    • 4
      Gain insights into using Civitai Companion with different AI image generation tools.
examples
tutorials
code samples
visuals
fundamentals
advanced content
practical tips
best practices

Introduction to Civitai Companion

Civitai Companion is a powerful utility designed to streamline the process of working with AI-generated images from Civitai.com. This tool addresses the needs of AI artists and enthusiasts by automating the extraction of prompt metadata, downloading necessary resources, and formatting information for use in various AI image generation tools. Originally conceived as a companion for Dream Factory, Civitai Companion has evolved to support multiple platforms, including Automatic1111 and others, through its flexible template system.

Key Features

Civitai Companion offers a robust set of features to enhance your AI image workflow: 1. Batch Metadata Extraction: Efficiently extracts prompts and associated metadata from Civitai images and Dream Factory creations. 2. Automatic Resource Downloads: Downloads models, LoRAs, and embeddings required for image generation, with customizable options for file types and sizes. 3. Customizable Output Formatting: Uses a template-driven system to output extracted information in user-specified formats. 4. LoRA Path Optimization: Automatically modifies LoRA references to match your local path structure. 5. Metadata Value Adjustment: Allows setting min/max values for certain prompt metadata, ensuring compatibility with your setup. 6. Content Filtering: Offers options to remove unwanted words or LoRAs from prompts automatically. 7. Image Dimension Optimization: Resizes images to the closest 'official' resolution for the base model while preserving aspect ratio. 8. Sampler Name Translation: Converts unsupported sampler names to compatible alternatives for tools like Automatic1111.

Setup and Requirements

Setting up Civitai Companion is straightforward: 1. Requirements: A working Python environment (tested on 3.10). 2. Installation: - Clone the repository: `git clone https://github.com/rbbrdckybk/civitai-companion` - Navigate to the directory: `cd civitai-companion` - Install required packages: `pip install --no-input requests tqdm pillow` If you're already using Dream Factory, you may skip the package installation step.

Usage Guide

To use Civitai Companion: 1. Run the script: `python civitai_reader.py --config_file config-example.txt` 2. The tool will scan sample images, extract metadata, download referenced LoRAs, and create an output file. 3. For full functionality, obtain a Civitai API key and add it to your config file. 4. Customize settings in the config file to suit your needs. The tool will process images, download resources, and generate output files based on your configuration and chosen template.

Template Reference

Civitai Companion uses a flexible template system for formatting output. Key tokens include: - [PROMPT]: The positive prompt used for the image - [NEG_PROMPT]: The negative prompt - [MODEL]: The model used - [SEED], [SAMPLER], [CLIP_SKIP], [WIDTH], [HEIGHT], [SCALE], [STEPS]: Various generation parameters - [BASE_MODEL]: The base model (e.g., SDXL 1.0, SD 1.5) - [FILENAME], [FILEPATH]: Original image file information Refer to the template-example.txt file for a complete list of available tokens and formatting options.

Advanced Usage Tips

To get the most out of Civitai Companion: 1. Use command-line arguments to override config file settings for specific workflows. 2. Check the log.txt file in the logs folder for detailed run information and troubleshooting. 3. Manage resource blacklisting by editing the do_not_download.txt file in the cache folder. 4. Utilize the civitai_version_ids.txt file to find version IDs for specific resources. These advanced features allow for fine-tuned control and customization of your Civitai Companion workflow, enabling you to optimize your AI image generation process efficiently.

 Original link: https://github.com/rbbrdckybk/civitai-companion

Logo for Civitai

Civitai

Civitai

Comment(0)

user's avatar

    Related Tools