Skip to content

Instantly share code, notes, and snippets.

@EvanBalster
Created May 30, 2021 20:59
Show Gist options
  • Save EvanBalster/60969a19901c6fb1792ba555369685f5 to your computer and use it in GitHub Desktop.
Save EvanBalster/60969a19901c6fb1792ba555369685f5 to your computer and use it in GitHub Desktop.
Interactive script to run big-sleep many times on the same training phrase
@echo off
setlocal EnableDelayedExpansion
cd %~dp0
echo
set /p FOLDER=Name directory:
echo ... Multiple training phrases or penalized phrases may be separated with vertical bar characters...
echo ... Penalized phrases will be avoided in image generation.
set /p PHRASE=Enter training phrase:
set /p PENALIZE=Enter penalized phrase (or leave blank):
set ITERATIONS=500
set EPOCHS=1
set SAVE_EVERY=50
mkdir "%FOLDER%"
cd "%FOLDER%"
echo text:%PHRASE:|=^|% > info.txt
echo text_min:%PENALIZE:|=^|% >> info.txt
echo epochs:%EPOCHS% >> info.txt
echo iterations:%ITERATIONS% >> info.txt
echo save_every:%SAVE_EVERY% >> info.txt
for /L %%S in (1,1,100) DO (
@echo on
mkdir %%S
cd %%S
dream "%PHRASE%" --text-min="%PENALIZE%" --save-progress --save-best --seed="%%S" --epochs="%EPOCHS%" --iterations="%ITERATIONS%" --save-every="%SAVE_EVERY%" --open_folder=False
copy /B *.best.png ..\%%S.png
cd ..
@echo off
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment