Guest User

Untitled

a guest
Feb 12th, 2025
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.81 KB | None | 0 0
  1. #Create ffmpeg screencap folders
  2.  
  3. $Total_Number_Of_Screenshots = 15000
  4.  
  5. $dirs = @(
  6. "\\GORGON\Stheno\Downloads\Monogatari_Series",
  7. "\\GORGON\Stheno\Downloads\Stein's_Gate"
  8. )
  9.  
  10.  
  11. foreach ($dir in $dirs) {
  12. $Name = $dir.Split("\")[-1]
  13. $OutputPath = "H:\Snips_To_Tag\$Name"
  14. New-Item -ItemType Directory -Path $OutputPath -ErrorAction SilentlyContinue
  15. $Counter = 1
  16. $inputpath = $dir
  17. $InputVideos = (Get-ChildItem -Path $inputpath -Recurse -Force).FullName
  18. $totalFrames = $InputVideos.Count * 24 * 60 * 24
  19. $TotalEpisodes = $InputVideos.Count
  20. $ScreenshotEveryXFrames = ($totalFrames / $Total_Number_Of_Screenshots)
  21. $ScreenshotEveryXSeconds = [math]::Floor($ScreenshotEveryXFrames / 24)
  22. #$ScreenshotEveryXSeconds = ($ScreenshotEveryXFrames / 24)
  23. if($ScreenshotEveryXSeconds -eq 0){$ScreenshotEveryXSeconds = 1}
  24. $FPS = "fps=1/$ScreenshotEveryXSeconds"
  25.  
  26. #Illustrious+Pony Style Lora Tomls (Frankenstein)
  27. $inputFileI = "F:\AI\stable-diffusion-webui-forge\webui\models\Lora\Frankenstein_Base_Illustrious.toml"
  28. $outputFileI = "F:\AI\stable-diffusion-webui-forge\webui\models\Lora\$Name`_SD8_Illustrious.toml"
  29. $contentI = Get-Content -Path $inputFileI -Raw
  30. $newContentI = $contentI -replace "IMAGEDIRECTORYPATH", "H:/Snips_Tagged`/$Name" -replace "LORAOUTPUTNAME", "$Name`_SD8_Illustrious"
  31. $newContentI | Set-Content -Path $outputFileI
  32. $inputFileP = "F:\AI\stable-diffusion-webui-forge\webui\models\Lora\Frankenstein_Base_Pony.toml"
  33. $outputFileP = "F:\AI\stable-diffusion-webui-forge\webui\models\Lora\$Name`_SD8_Pony.toml"
  34. $contentP = Get-Content -Path $inputFileP -Raw
  35. $newContentP = $contentP -replace "IMAGEDIRECTORYPATH", "H:/Snips_Tagged`/$Name" -replace "LORAOUTPUTNAME", "$Name`_SD8_Pony"
  36. $newContentP | Set-Content -Path $outputFileP
  37.  
  38. foreach ($InputVideo in $InputVideos) {
  39. #ffmpeg -hwaccel cuda -i "$InputVideo" -vf $FPS "$OutputPath\$Counter-$%08d.png"
  40. ffmpeg -hwaccel cuda -i "$InputVideo" -vf "fps=$FPS" "$OutputPath\$Counter-$%08d.png"
  41. #ffmpeg -hwaccel cuda -i "$InputVideo" -vf "fps=4/1" "$OutputPath\$Counter-$%08d.png"
  42. Write-Host "$Name - $Counter"
  43. $Counter++
  44. $Number_Of_Screenshots = (Get-ChildItem -Path $OutputPath).Count
  45. if ($Number_Of_Screenshots -ge $Total_Number_Of_Screenshots) { Break }
  46.  
  47. }
  48. }
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56. #TOML for easy training scripts
  57.  
  58. [[subsets]]
  59. num_repeats = 1
  60. caption_extension = ".txt"
  61. shuffle_caption = true
  62. flip_aug = false
  63. is_reg = false
  64. image_dir = "H:/Snips_Tagged/SpyXFamily"
  65. keep_tokens = 0
  66.  
  67. [noise_args]
  68.  
  69. [sample_args]
  70.  
  71. [logging_args]
  72.  
  73. [general_args.args]
  74. pretrained_model_name_or_path = "F:/AI/Training/Training_Model/Illustrious-XL-v0.1.safetensors"
  75. mixed_precision = "bf16"
  76. seed = 80085
  77. max_data_loader_n_workers = 1
  78. persistent_data_loader_workers = true
  79. max_token_length = 225
  80. prior_loss_weight = 1.0
  81. no_half_vae = true
  82. vae = "F:/AI/Training/Training_Model/sdXL_v10VAEFix.safetensors"
  83. max_train_steps = 15000
  84. sdxl = true
  85. xformers = true
  86. cache_latents = true
  87.  
  88. [general_args.dataset_args]
  89. resolution = 768
  90. batch_size = 2
  91.  
  92. [network_args.args]
  93. network_dim = 32
  94. network_alpha = 16.0
  95. min_timestep = 0
  96. max_timestep = 1000
  97. network_train_unet_only = true
  98.  
  99. [optimizer_args.args]
  100. optimizer_type = "Prodigy"
  101. lr_scheduler = "cosine"
  102. learning_rate = 1.0
  103. max_grad_norm = 1.0
  104.  
  105. [saving_args.args]
  106. output_dir = "F:/AI/stable-diffusion-webui-forge/webui/models/Lora"
  107. save_precision = "fp16"
  108. save_model_as = "safetensors"
  109. output_name = "Spy_X_Family_SD8_Illustrious"
  110. tag_occurrence = true
  111. save_toml = true
  112.  
  113. [bucket_args.dataset_args]
  114. enable_bucket = true
  115. min_bucket_reso = 256
  116. max_bucket_reso = 2048
  117. bucket_reso_steps = 256
  118.  
  119. [optimizer_args.args.optimizer_args]
  120. weight_decay = "0.1"
  121. betas = "0.9,0.99"
  122. decouple = "True"
  123.  
Advertisement
Add Comment
Please, Sign In to add comment