Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Confuzu/CivitAI_Image_grabber
/ functions
Functions
67 in github.com/Confuzu/CivitAI_Image_grabber
⨍
Functions
67
◇
Types & classes
4
↓ 13 callers
Method
_is_interactive_mode
(self)
civit_image_downloader.py:391
↓ 8 callers
Method
_clean_path_component
Cleans/shortens a filename or directory name component using simple replacement.
civit_image_downloader.py:2115
↓ 8 callers
Method
_image_api_url
Builds CivitAI image API URLs with an explicit max page size. The API default is smaller than the documented maximum. Using 200 items
civit_image_downloader.py:574
↓ 7 callers
Method
_run_paginated_download
Handles pagination and processing for an identifier, checking for 'Not Found' errors. Args: deep_scan_pass: If set, this is a con
civit_image_downloader.py:1148
↓ 4 callers
Method
_get_client
Lazily creates and returns the shared httpx.AsyncClient instance.
civit_image_downloader.py:383
↓ 4 callers
Method
_get_result_entry
Helper to get the correct dictionary entry in run_results to update stats.
civit_image_downloader.py:522
↓ 4 callers
Function
is_retryable_http_status
(exception: BaseException)
civit_image_downloader.py:105
↓ 3 callers
Method
_sort_images_by_model_name
Sorts downloaded images and metadata files within a directory (base_dir) into subfolders based on the 'Model' field found in the meta
civit_image_downloader.py:2406
↓ 3 callers
Function
extract_image_meta
Extracts the actual metadata dict from an API item, handling nested structure. CivitAI API changed structure from: item["meta"] = {"p
civit_image_downloader.py:224
↓ 2 callers
Method
_create_option_folder
Creates mode-specific subfolder within output directory.
civit_image_downloader.py:2108
↓ 2 callers
Method
_get_disable_prompt_check
Gets the disable_prompt_check option (True/False) from args or interactive prompt.
civit_image_downloader.py:2025
↓ 2 callers
Method
_safe_move
Robust file moving with retries and logging, checking actual outcome.
civit_image_downloader.py:2161
↓ 2 callers
Method
_validate_next_page
Validates a pagination URL from the API to prevent SSRF attacks. Ensures the URL uses HTTPS, belongs to an allowed CivitAI API host (
civit_image_downloader.py:549
↓ 2 callers
Method
clear_target_history
Issue #58: Clear all tracked images for a specific target. Args: target_type: Type of target ('username', 'model', 'tag', 'modelV
civit_image_downloader.py:668
↓ 2 callers
Function
insert_image_batch
Inserts a batch of image data.
migrate_json_to_sqlite.py:88
↓ 2 callers
Function
insert_tag_batch
Inserts a batch of tag data.
migrate_json_to_sqlite.py:98
↓ 2 callers
Method
run
Main entry point to run the downloader based on initialized configuration. Collects identifiers, initializes results, dispatches task
civit_image_downloader.py:1623
↓ 1 callers
Method
_check_mismatched_arguments
Logs warnings if CLI arguments conflict with the selected mode.
civit_image_downloader.py:2386
↓ 1 callers
Method
_fetch_api_page
Fetches a single page from the Civitai images API, with retries.
civit_image_downloader.py:882
↓ 1 callers
Method
_fetch_model_details
Fetches one model record so modelId can be resolved to modelVersionIds.
civit_image_downloader.py:968
↓ 1 callers
Method
_get_filter_tags
Gets filter tags for Mode 4 from args or interactive prompt. Returns None if not specified.
civit_image_downloader.py:2086
↓ 1 callers
Method
_get_max_images
Get maximum images limit, prompting in interactive mode if not set via CLI.
civit_image_downloader.py:497
↓ 1 callers
Method
_get_mode_choice
(self)
civit_image_downloader.py:467
↓ 1 callers
Method
_get_model_ids
Gets model IDs from args or interactive prompt, validating numeric.
civit_image_downloader.py:1983
↓ 1 callers
Method
_get_model_version_ids
Gets model version IDs from args or interactive prompt, validating numeric.
civit_image_downloader.py:2059
↓ 1 callers
Method
_get_model_versions
Returns (modelVersionId, version name) pairs for a model ID.
civit_image_downloader.py:997
↓ 1 callers
Method
_get_quality
(self)
civit_image_downloader.py:435
↓ 1 callers
Method
_get_redownload_option
(self)
civit_image_downloader.py:455
↓ 1 callers
Method
_get_semaphore_limit
(self)
civit_image_downloader.py:479
↓ 1 callers
Method
_get_skip_videos
(self)
civit_image_downloader.py:446
↓ 1 callers
Method
_get_tags
Gets tags from args or interactive prompt, replacing spaces with underscores.
civit_image_downloader.py:2010
↓ 1 callers
Method
_get_timeout_value
Gets the timeout value from args or interactive prompt.
civit_image_downloader.py:394
↓ 1 callers
Method
_get_usernames
Gets usernames from args or interactive prompt.
civit_image_downloader.py:1973
↓ 1 callers
Method
_handle_single_download
Handles download, meta write, tracking, stats update for one item.
civit_image_downloader.py:1090
↓ 1 callers
Method
_init_db
Initializes the SQLite DB connection and creates tables if needed.
civit_image_downloader.py:326
↓ 1 callers
Method
_migrate_database_add_target_tracking
Issue #58: Add target_type and target_value columns for per-target DB management.
civit_image_downloader.py:365
↓ 1 callers
Function
_parse_retry_after
Return seconds from a Retry-After header, capped to avoid unbounded sleeps.
civit_image_downloader.py:130
↓ 1 callers
Method
_print_download_statistics
Prints the final download statistics summary, including per-identifier results and warnings.
civit_image_downloader.py:2258
↓ 1 callers
Method
_process_api_items
Processes image items: checks skip conditions, creates download tasks.
civit_image_downloader.py:1012
↓ 1 callers
Method
_run_deep_scan
Performs deep scan passes to retrieve images beyond the 50K API pagination cap. Strategy: 1. sort=Oldest pass: Paginates from the old
civit_image_downloader.py:1351
↓ 1 callers
Method
_run_model_id_download
Downloads all images for a Model ID by resolving its modelVersionIds first.
civit_image_downloader.py:1295
↓ 1 callers
Method
_run_verification
Compares downloaded image count against known website counts for verification. Loads website_image_counts.json and prints a completeness repo
civit_image_downloader.py:1474
↓ 1 callers
Method
_search_models_by_tag
Searches for model version IDs by tag, handling pagination and adding validation based on first page results and a maximum page limit
civit_image_downloader.py:1536
↓ 1 callers
Method
_search_models_by_tag_page
Helper: Fetches one page of model search results, with retries.
civit_image_downloader.py:1526
↓ 1 callers
Method
_validate_identifier_basic
Performs basic client-side validation. Returns (is_valid, reason_if_invalid).
civit_image_downloader.py:538
↓ 1 callers
Method
_write_meta_data
Writes metadata to a .txt file. Args: meta: Metadata dictionary extracted from API response base_output_path_no_ext:
civit_image_downloader.py:829
↓ 1 callers
Method
_write_tag_summaries
Writes CSV summaries for tags using SQLite data.
civit_image_downloader.py:2610
↓ 1 callers
Function
anext
(ait: AsyncGenerator, default: Any = _MISSING)
civit_image_downloader.py:41
↓ 1 callers
Method
check_if_image_downloaded
Checks if an image exists in the tracking database. Args: image_id: The image ID quality: Image quality (SD/HD)
civit_image_downloader.py:586
↓ 1 callers
Function
configure_logging
Adjust logger and handler levels after CLI arguments are known.
civit_image_downloader.py:201
↓ 1 callers
Function
detect_extension
Detects file extension from magic numbers.
civit_image_downloader.py:215
↓ 1 callers
Method
download_image
Downloads a single image or video, detects extension, saves, with retries.
civit_image_downloader.py:713
↓ 1 callers
Function
fetch_data
(url)
tagnames.py:11
↓ 1 callers
Function
initialize_db
Connects to DB and ensures schema exists.
migrate_json_to_sqlite.py:39
↓ 1 callers
Function
main
()
migrate_json_to_sqlite.py:107
↓ 1 callers
Method
mark_image_as_downloaded
Marks image as downloaded in DB (INSERT OR REPLACE image, DELETE/INSERT tags). Args: image_id: The image ID image_pat
civit_image_downloader.py:614
↓ 1 callers
Function
parse_arguments
Parses command-line arguments.
civit_image_downloader.py:172
↓ 1 callers
Function
process_data
(items, file_path, read_existing_tag)
tagnames.py:25
↓ 1 callers
Function
read_existing_tag
(file_path)
tagnames.py:34
Method
__call__
(self, retry_state)
civit_image_downloader.py:148
Method
__call__
(self, retry_state)
civit_image_downloader.py:153
Method
__call__
(self, retry_state)
civit_image_downloader.py:161
Method
__init__
(self, multiplier: float = 1, max_wait: float = 10)
civit_image_downloader.py:158
Method
__init__
Initializes the downloader with configuration and database connection.
civit_image_downloader.py:257
Function
download_failed_after_retry
(retry_state)
civit_image_downloader.py:125
Function
return_none_after_retry
(retry_state)
civit_image_downloader.py:111
Function
should_retry_exception
(exception: BaseException)
civit_image_downloader.py:108