///
This page outlines the core database schema and primary API endpoints that power the Infinite Image Browsing application.
51 views
~51 views from guests
Guest views are estimated from total page views. These include anonymous visitors and users who weren't logged in when they viewed the page.
This page outlines the core database schema and primary API endpoints that power the Infinite Image Browsing application.
The application uses an SQLite database (iib.db) to store and manage image metadata, tags, and internal settings. Below is an overview of the main tables and their purposes:
Image
id (INTEGER PRIMARY KEY AUTOINCREMENT): Unique identifier for the image.path (TEXT UNIQUE): Absolute file path to the media file.exif (TEXT): Raw generation information (e.g., Stable Diffusion parameters, ComfyUI prompt JSON).size (INTEGER): File size in bytes.date (TEXT): Last modified date of the file.ImageEmbedding
image_id (INTEGER PRIMARY KEY): Foreign key referencing Image.id.model (TEXT NOT NULL): The embedding model used (e.g., text-embedding-3-small).dim (INTEGER NOT NULL): Dimensionality of the embedding vector.text_hash (TEXT NOT NULL): SHA256 hash of the normalized prompt text, used for incremental updates.vec (BLOB NOT NULL): The embedding vector, stored as float32 bytes.updated_at (TEXT NOT NULL): Timestamp of the last update.ImageEmbeddingFail
image_id (INTEGER NOT NULL): Foreign key referencing Image.id.model (TEXT NOT NULL): The embedding model that failed.text_hash (TEXT NOT NULL): Hash of the normalized prompt text that caused the failure.error (TEXT NOT NULL): Error message from the failed attempt.updated_at (TEXT NOT NULL): Timestamp of the last update.TopicTitleCache
cluster_hash (TEXT PRIMARY KEY): A hash representing the unique configuration of a cluster (member images, clustering parameters, etc.).title (TEXT NOT NULL): The LLM-generated concise title for the cluster.keywords (TEXT NOT NULL): JSON string of LLM-generated keywords.model (TEXT NOT NULL): The chat model used for title generation.updated_at (TEXT NOT NULL): Timestamp of the last update.TopicClusterCache
cache_key (TEXT PRIMARY KEY): A hash derived from the folders, embedding model, and clustering parameters.folders (TEXT NOT NULL): JSON array of the folders included in the clustering scope.model (TEXT NOT NULL): The embedding model used for the clusters.params (TEXT NOT NULL): JSON string of the clustering parameters used.embeddings_count (INTEGER NOT NULL): Count of images with embeddings at the time of caching.embeddings_max_updated_at (TEXT NOT NULL): Latest updated_at timestamp of any embedding used.result (TEXT NOT NULL): JSON string representing the full clustering result (clusters, noise, etc.).updated_at (TEXT NOT NULL): Timestamp of the last update.Tag
id (INTEGER PRIMARY KEY AUTOINCREMENT): Unique identifier for the tag.name (TEXT): The name of the tag.score (INTEGER): A numerical score, potentially for relevance or frequency.type (TEXT): Category of the tag (e.g., 'pos' for positive prompt, 'lora', 'custom', 'size', 'Media Type').count (INTEGER): Number of times the tag has been applied to images.color (TEXT): Custom color for the tag (especially for 'custom' type).ImageTag
Image records to Tag records, indicating which tags are applied to which images.image_id (INTEGER): Foreign key referencing Image.id.tag_id (INTEGER): Foreign key referencing Tag.id.created_at (TIMESTAMP): Timestamp when the tag was associated with the image.Folder
id (INTEGER PRIMARY KEY AUTOINCREMENT): Unique identifier for the folder record.path (TEXT): Absolute file path to the folder.modified_date (TEXT): Last modified date of the folder.ExtraPath
path (TEXT PRIMARY KEY): Absolute file path to the extra directory.type (TEXT NOT NULL): Defines how the path is used (e.g., 'scanned', 'walk', 'cli_access_only').alias (TEXT DEFAULT ''): An optional, user-friendly alias for the path.GlobalSetting
name (TEXT PRIMARY KEY): The name of the setting.setting_json (TEXT): The value of the setting, stored as a JSON string.created_time (TEXT): Timestamp when the setting was created.modified_time (TEXT): Timestamp of the last modification.The Infinite Image Browsing application exposes a FastAPI-based API for interacting with the backend. The base path for the API is /infinite_image_browsing (or a configurable alternative).
GET /infinite_image_browsing/hello
GET /infinite_image_browsing/global_setting
POST /infinite_image_browsing/app_fe_setting
GlobalSetting table.name (string), value (string, JSON representation).DELETE /infinite_image_browsing/app_fe_setting
GlobalSetting table.name (string).GET /infinite_image_browsing/version
POST /infinite_image_browsing/delete_files
file_paths (List[str]).POST /infinite_image_browsing/mkdirs
dest_folder (str).POST /infinite_image_browsing/copy_files
.txt metadata files) to a destination folder.file_paths (List[str]), dest (str), create_dest_folder (Optional[bool]).POST /infinite_image_browsing/move_files
.txt metadata files) to a destination folder, updating database paths accordingly.file_paths (List[str]), dest (str), create_dest_folder (Optional[bool]).GET /infinite_image_browsing/files
folder_path (str).POST /infinite_image_browsing/batch_get_files_info
paths (List[str]).GET /infinite_image_browsing/image-thumbnail
path (str), t (str, timestamp for cache busting), size (str, e.g., "256x256").GET /infinite_image_browsing/file
path (str), t (str, timestamp for cache busting), disposition (Optional[str], filename for download).GET /infinite_image_browsing/stream_video
path (str).GET /infinite_image_browsing/video_cover
path (str), mt (str, timestamp for cache busting).POST /infinite_image_browsing/set_target_frame_as_video_cover
base64_img (str), path (str), updated_time (str).POST /infinite_image_browsing/send_img_path
path (str).GET /infinite_image_browsing/gen_info_completed
send_img_path) has completed.GET /infinite_image_browsing/image_geninfo
.txt sidecar files) for a single image or video.path (str).POST /infinite_image_browsing/image_geninfo_batch
paths (List[str]).POST /infinite_image_browsing/check_path_exists
paths (List[str]).GET /infinite_image_browsing
GET /infinite_image_browsing/fe-static/{file_path:path}
POST /infinite_image_browsing/open_folder
path (str).POST /infinite_image_browsing/shutdown
POST /infinite_image_browsing/zip
paths (List[str]), compress (bool), pack_only (bool).POST /infinite_image_browsing/open_with_default_app
path (str).POST /infinite_image_browsing/batch_top_4_media_info
paths (List[str])./infinite_image_browsing/db)GET /infinite_image_browsing/db/basic_info
GET /infinite_image_browsing/db/random_images
GET /infinite_image_browsing/db/expired_dirs
POST /infinite_image_browsing/db/update_image_data
POST /infinite_image_browsing/db/search_by_substr
surstr (str), cursor (str), regexp (str), folder_paths (List[str]), size (Optional[int]), path_only (Optional[bool]), media_type (Optional[str]).POST /infinite_image_browsing/db/match_images_by_tags
and_tags (List[int]), or_tags (List[int]), not_tags (List[int]), cursor (str), folder_paths (List[str]), size (Optional[int]), random_sort (Optional[bool]).GET /infinite_image_browsing/db/img_selected_custom_tag
path (str).POST /infinite_image_browsing/db/get_image_tags
paths (List[str]).POST /infinite_image_browsing/db/update_tag
id (int), color (str).POST /infinite_image_browsing/db/toggle_custom_tag_to_img
img_path (str), tag_id (int).POST /infinite_image_browsing/db/batch_update_image_tag
img_paths (List[str]), action ('add' | 'remove'), tag_id (int).POST /infinite_image_browsing/db/add_custom_tag
tag_name (str).POST /infinite_image_browsing/db/rename
path (str), name (str).POST /infinite_image_browsing/db/remove_custom_tag
tag_id (int).POST /infinite_image_browsing/db/remove_custom_tag_from_img
img_id (int), tag_id (str).POST /infinite_image_browsing/db/extra_paths
path (str), types (List[str]).POST /infinite_image_browsing/db/alias_extra_path
path (str), alias (str).GET /infinite_image_browsing/db/extra_paths
DELETE /infinite_image_browsing/db/extra_paths
path (str), types (List[str]).POST /infinite_image_browsing/db/rebuild_index
/infinite_image_browsing/db)These endpoints are part of the [Natural Language AI Features (Experimental)] and are integrated into the main API.
POST /infinite_image_browsing/db/build_iib_output_embeddings
folder (Optional[str]), model (Optional[str]), force (Optional[bool]), batch_size (Optional[int]), max_chars (Optional[int]).POST /infinite_image_browsing/db/cluster_iib_output_cached
folder (Optional[str]), folder_paths (Optional[List[str]]), model (Optional[str]), force_embed (Optional[bool]), threshold (Optional[float]), min_cluster_size (Optional[int]), lang (Optional[str]), force_title (Optional[bool]), use_title_cache (Optional[bool]), assign_noise_threshold (Optional[float]).POST /infinite_image_browsing/db/cluster_iib_output_job_start
job_id for status polling.cluster_iib_output_cached).GET /infinite_image_browsing/db/cluster_iib_output_job_status
job_id (str).POST /infinite_image_browsing/db/search_iib_output_by_prompt
query (str), folder (Optional[str]), folder_paths (Optional[List[str]]), model (Optional[str]), top_k (Optional[int]), min_score (Optional[float]), ensure_embed (Optional[bool]), max_chars (Optional[int]).POST /infinite_image_browsing/db/cluster_tag_graph
folder_paths (List[str]), lang (Optional[str]).POST /infinite_image_browsing/db/cluster_tag_graph_cluster_paths
cluster_id and the topic_cluster_cache_key.topic_cluster_cache_key (str), cluster_id (str).POST /infinite_image_browsing/ai-chat
messages (List[dict]), temperature (Optional[float]), max_tokens (Optional[int]), stream (Optional[bool]).