Download examples/caption.ps1 from ABCCCYYY/kohya_ss: direct link, hf CLI and curl.
- Browser
- Download file 554 Bytes
-
https://huggingface.co/spaces/ABCCCYYY/kohya_ss/resolve/main/examples/caption.ps1
- Command line
-
hf download hf://spaces/ABCCCYYY/kohya_ss/examples/caption.ps1
-
curl -L -o caption.ps1 https://huggingface.co/spaces/ABCCCYYY/kohya_ss/resolve/main/examples/caption.ps1
554 Bytes
| # This powershell script will create a text file for each files in the folder | |
| # | |
| # Useful to create base caption that will be augmented on a per image basis | |
| $folder = "D:\some\folder\location\" | |
| $file_pattern="*.*" | |
| $caption_text="some caption text" | |
| $files = Get-ChildItem $folder$file_pattern -Include *.png, *.jpg, *.webp -File | |
| foreach ($file in $files) { | |
| if (-not(Test-Path -Path $folder\"$($file.BaseName).txt" -PathType Leaf)) { | |
| New-Item -ItemType file -Path $folder -Name "$($file.BaseName).txt" -Value $caption_text | |
| } | |
| } |