forked from basujindal/stable-diffusion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtxt2img.py
28 lines (19 loc) · 831 Bytes
/
txt2img.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import os
import sys
import utils
from colorama import init, Fore
import pyinputplus as pyip
def main():
init()
os.system('CLS')
print(f'{Fore.YELLOW}Read up on the documentation at https://github.com/philparzer/stable-diffusion-for-dummies#readme if you have any troubles\n{Fore.WHITE}')
HEIGHT, WIDTH, N_ITER, N_SAMPLES, USE_SEED, SEED = utils.read_config()
prompt = pyip.inputStr(f"\n{Fore.BLUE}Enter your PROMPT:{Fore.WHITE}\n")
print(f'{Fore.GREEN}Set PROMPT to "{prompt}"')
print(f'\n{Fore.YELLOW}STARTING...\n{Fore.WHITE}')
command = f'python optimizedSD/optimized_txt2img.py --prompt "{prompt}" --n_samples {N_SAMPLES} --n_iter {N_ITER} --W {WIDTH} --H {HEIGHT}'
if(USE_SEED):
command += f' --seed {SEED}'
os.system(command)
if __name__ == "__main__":
main()