CivArchive
    ← All articles
    Published September 18, 2024by zentrocdot

    Meta Data Key Words

    217 views5 reactions0 comments on CivitAI2 collected
    metadatatool guide

    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:

    1. modelspec.architecture

    2. modelspec.date

    3. modelspec.encoder_layer

    4. modelspec.implementation

    5. modelspec.prediction_type

    6. modelspec.resolution

    7. modelspec.sai_model_spec

    8. modelspec.tags

    9. modelspec.title

    10. sd_version

    11. ss_adaptive_noise_scale

    12. ss_base_model_version

    13. ss_batch_size_per_device

    14. ss_bucket_info

    15. ss_bucket_no_upscale

    16. ss_cache_latents

    17. ss_caption_dropout_every_n_epochs

    18. ss_caption_dropout_rate

    19. ss_caption_tag_dropout_rate

    20. ss_clip_skip

    21. ss_color_aug

    22. ss_dataset_dirs

    23. ss_datasets

    24. ss_enable_bucket

    25. ss_epoch

    26. ss_face_crop_aug_range

    27. ss_flip_aug

    28. ss_full_fp16

    29. ss_gradient_accumulation_steps

    30. ss_gradient_checkpointing

    31. sshs_legacy_hash

    32. sshs_model_hash

    33. ss_keep_tokens

    34. ss_learning_rate

    35. ss_lowram

    36. ss_lr_scheduler

    37. ss_lr_scheduler_num_cycles

    38. ss_lr_scheduler_power

    39. ss_lr_step_rules

    40. ss_lr_warmup_steps

    41. ss_max_bucket_reso

    42. ss_max_grad_norm

    43. ss_max_token_length

    44. ss_max_train_steps

    45. ssmd_author

    46. ssmd_cover_images

    47. ssmd_description

    48. ssmd_display_name

    49. ssmd_keywords

    50. ssmd_rating

    51. ssmd_source

    52. ssmd_tags

    53. ss_min_bucket_reso

    54. ss_min_snr_gamma

    55. ss_mixed_precision

    56. ss_multires_noise_discount

    57. ss_multires_noise_iterations

    58. ss_network_alpha

    59. ss_network_dim

    60. ss_network_dropout

    61. ss_network_module

    62. ss_new_sd_model_hash

    63. ss_new_vae_hash

    64. ss_noise_offset

    65. ss_num_batches_per_epoch

    66. ss_num_epochs

    67. ss_num_reg_images

    68. ss_num_train_images

    69. ss_optimizer

    70. ss_output_name

    71. ss_prior_loss_weight

    72. ss_random_crop

    73. ss_reg_dataset_dirs

    74. ss_resolution

    75. ss_scale_weight_norms

    76. ss_sd_model_hash

    77. ss_sd_model_name

    78. ss_sd_scripts_commit_hash

    79. ss_seed

    80. ss_session_id

    81. ss_shuffle_caption

    82. ss_shuffle_captions

    83. ss_steps

    84. ss_tag_frequency

    85. ss_text_encoder_lr

    86. ss_total_batch_size

    87. ss_training_comment

    88. ss_training_finished_at

    89. ss_training_started_at

    90. ss_unet_lr

    91. ss_v2

    92. ss_vae_hash

    93. 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