forked from basujindal/stable-diffusion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimg_queue.py
23 lines (16 loc) · 979 Bytes
/
img_queue.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
import utils
import pyinputplus as pyip
from colorama import init, Fore
init()
HEIGHT, WIDTH, N_ITER, N_SAMPLES, USE_SEED, SEED = utils.read_config()
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}')
init_image_path = pyip.inputCustom(utils.check_init_img_path, 'Specify the path to the source image: ')
print('Specify how much the created images should resemble the original image:')
strength = pyip.inputFloat('Enter a value between 0.0 (indistinguishable) and 0.9 (minor similarity):', min=0.0, max=0.9) # 1 throws
print(f'\n{Fore.YELLOW}STARTING...\n{Fore.WHITE}')
command = f'python optimizedSD/optimized_img2img.py --from-file prompt_list.txt --init-img "{init_image_path}" --strength {strength} --n_samples {N_SAMPLES} --n_iter {N_ITER} --W {WIDTH} --H {HEIGHT}'
if(USE_SEED):
command += f' --seed {SEED}'
os.system(command)