Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Create ffmpeg screencap folders
- $Total_Number_Of_Screenshots = 15000
- $dirs = @(
- "\\GORGON\Stheno\Downloads\Monogatari_Series",
- "\\GORGON\Stheno\Downloads\Stein's_Gate"
- )
- foreach ($dir in $dirs) {
- $Name = $dir.Split("\")[-1]
- $OutputPath = "H:\Snips_To_Tag\$Name"
- New-Item -ItemType Directory -Path $OutputPath -ErrorAction SilentlyContinue
- $Counter = 1
- $inputpath = $dir
- $InputVideos = (Get-ChildItem -Path $inputpath -Recurse -Force).FullName
- $totalFrames = $InputVideos.Count * 24 * 60 * 24
- $TotalEpisodes = $InputVideos.Count
- $ScreenshotEveryXFrames = ($totalFrames / $Total_Number_Of_Screenshots)
- $ScreenshotEveryXSeconds = [math]::Floor($ScreenshotEveryXFrames / 24)
- #$ScreenshotEveryXSeconds = ($ScreenshotEveryXFrames / 24)
- if($ScreenshotEveryXSeconds -eq 0){$ScreenshotEveryXSeconds = 1}
- $FPS = "fps=1/$ScreenshotEveryXSeconds"
- #Illustrious+Pony Style Lora Tomls (Frankenstein)
- $inputFileI = "F:\AI\stable-diffusion-webui-forge\webui\models\Lora\Frankenstein_Base_Illustrious.toml"
- $outputFileI = "F:\AI\stable-diffusion-webui-forge\webui\models\Lora\$Name`_SD8_Illustrious.toml"
- $contentI = Get-Content -Path $inputFileI -Raw
- $newContentI = $contentI -replace "IMAGEDIRECTORYPATH", "H:/Snips_Tagged`/$Name" -replace "LORAOUTPUTNAME", "$Name`_SD8_Illustrious"
- $newContentI | Set-Content -Path $outputFileI
- $inputFileP = "F:\AI\stable-diffusion-webui-forge\webui\models\Lora\Frankenstein_Base_Pony.toml"
- $outputFileP = "F:\AI\stable-diffusion-webui-forge\webui\models\Lora\$Name`_SD8_Pony.toml"
- $contentP = Get-Content -Path $inputFileP -Raw
- $newContentP = $contentP -replace "IMAGEDIRECTORYPATH", "H:/Snips_Tagged`/$Name" -replace "LORAOUTPUTNAME", "$Name`_SD8_Pony"
- $newContentP | Set-Content -Path $outputFileP
- foreach ($InputVideo in $InputVideos) {
- #ffmpeg -hwaccel cuda -i "$InputVideo" -vf $FPS "$OutputPath\$Counter-$%08d.png"
- ffmpeg -hwaccel cuda -i "$InputVideo" -vf "fps=$FPS" "$OutputPath\$Counter-$%08d.png"
- #ffmpeg -hwaccel cuda -i "$InputVideo" -vf "fps=4/1" "$OutputPath\$Counter-$%08d.png"
- Write-Host "$Name - $Counter"
- $Counter++
- $Number_Of_Screenshots = (Get-ChildItem -Path $OutputPath).Count
- if ($Number_Of_Screenshots -ge $Total_Number_Of_Screenshots) { Break }
- }
- }
- #TOML for easy training scripts
- [[subsets]]
- num_repeats = 1
- caption_extension = ".txt"
- shuffle_caption = true
- flip_aug = false
- is_reg = false
- image_dir = "H:/Snips_Tagged/SpyXFamily"
- keep_tokens = 0
- [noise_args]
- [sample_args]
- [logging_args]
- [general_args.args]
- pretrained_model_name_or_path = "F:/AI/Training/Training_Model/Illustrious-XL-v0.1.safetensors"
- mixed_precision = "bf16"
- seed = 80085
- max_data_loader_n_workers = 1
- persistent_data_loader_workers = true
- max_token_length = 225
- prior_loss_weight = 1.0
- no_half_vae = true
- vae = "F:/AI/Training/Training_Model/sdXL_v10VAEFix.safetensors"
- max_train_steps = 15000
- sdxl = true
- xformers = true
- cache_latents = true
- [general_args.dataset_args]
- resolution = 768
- batch_size = 2
- [network_args.args]
- network_dim = 32
- network_alpha = 16.0
- min_timestep = 0
- max_timestep = 1000
- network_train_unet_only = true
- [optimizer_args.args]
- optimizer_type = "Prodigy"
- lr_scheduler = "cosine"
- learning_rate = 1.0
- max_grad_norm = 1.0
- [saving_args.args]
- output_dir = "F:/AI/stable-diffusion-webui-forge/webui/models/Lora"
- save_precision = "fp16"
- save_model_as = "safetensors"
- output_name = "Spy_X_Family_SD8_Illustrious"
- tag_occurrence = true
- save_toml = true
- [bucket_args.dataset_args]
- enable_bucket = true
- min_bucket_reso = 256
- max_bucket_reso = 2048
- bucket_reso_steps = 256
- [optimizer_args.args.optimizer_args]
- weight_decay = "0.1"
- betas = "0.9,0.99"
- decouple = "True"
Advertisement
Add Comment
Please, Sign In to add comment