Foreword
While I was working on the metadata in the .safetensors files, the question arose as to what keywords there could or might be.
Keep in mind, that metadata per definition of .safetensors format are optional. Up to now I have seen one .safetensors file without metadata.
I continue the list at Copus [4].
Why Collecting Key Words
From my point of view, it is helpful to learn a little more about a model by analyzing the keywords from the metadata, if there is metadata.
Key Words
I identified so far over 100 keywords analysing different LoRA files. Herefor I used my script for reading the header. Per copy and paste I created a temporary text file where I collected the metadata. The preparation of sorted data is done by a tiny Bash script [3].
Following keywords can be found in metadata:
modelspec.architecture
modelspec.encoder_layer
modelspec.implementation
modelspec.prediction_type
modelspec.resolution
modelspec.sai_model_spec
modelspec.tags
modelspec.title
sd_version
ss_adaptive_noise_scale
ss_base_model_version
ss_batch_size_per_device
ss_bucket_info
ss_bucket_no_upscale
ss_cache_latents
ss_caption_dropout_every_n_epochs
ss_caption_dropout_rate
ss_caption_tag_dropout_rate
ss_clip_skip
ss_color_aug
ss_dataset_dirs
ss_datasets
ss_enable_bucket
ss_epoch
ss_face_crop_aug_range
ss_flip_aug
ss_full_fp16
ss_gradient_accumulation_steps
ss_gradient_checkpointing
sshs_legacy_hash
sshs_model_hash
ss_keep_tokens
ss_learning_rate
ss_lowram
ss_lr_scheduler
ss_lr_scheduler_num_cycles
ss_lr_scheduler_power
ss_lr_step_rules
ss_lr_warmup_steps
ss_max_bucket_reso
ss_max_grad_norm
ss_max_token_length
ss_max_train_steps
ssmd_author
ssmd_cover_images
ssmd_description
ssmd_display_name
ssmd_keywords
ssmd_rating
ssmd_source
ssmd_tags
ss_min_bucket_reso
ss_min_snr_gamma
ss_mixed_precision
ss_multires_noise_discount
ss_multires_noise_iterations
ss_network_alpha
ss_network_dim
ss_network_dropout
ss_network_module
ss_new_sd_model_hash
ss_new_vae_hash
ss_noise_offset
ss_num_batches_per_epoch
ss_num_epochs
ss_num_reg_images
ss_num_train_images
ss_optimizer
ss_output_name
ss_prior_loss_weight
ss_random_crop
ss_reg_dataset_dirs
ss_resolution
ss_scale_weight_norms
ss_sd_model_hash
ss_sd_model_name
ss_sd_scripts_commit_hash
ss_seed
ss_session_id
ss_shuffle_caption
ss_shuffle_captions
ss_steps
ss_tag_frequency
ss_text_encoder_lr
ss_total_batch_size
ss_training_comment
ss_training_finished_at
ss_training_started_at
ss_unet_lr
ss_v2
ss_vae_hash
ss_vae_name
Side Note
While working on the topic I found one .safetensors file, where the specification from Stability AI is used. Normally a keyword starts with ss_ (sshs_, ssmd_). In this special case some keywords started also with modelspec.
Technical Background
The metadata section in the header of a .safetensors files is optional. There will be e.g. some LoRA where is no such section in the header, as stated earlier.
To-Do
When I see the benefit, I will write a Python script that automatically reads .safetensor files, extracts the metadata and then creates a sorted keyword list for me.
Finally
Have a nice day. Have fun. Be inspired!
References
[1] https://github.com/Stability-AI/ModelSpec
[2] https://github.com/by321/safetensors_util
[3] https://github.com/zentrocdot/artificial-intelligence-tools/tree/main/bash
[4] https://www.copus.io/work/fb4fd05962dd4c2d8fc274af6bb750e9

