### Execute diffusion for created prompts.
cd ROOT_DIR # contextualize the script

### We expect you prepared safetensors / diffusers models! these models are gated or sometimes not packed properly in official repo.
### We tested this script in 5090x4GPU, 3090x4GPUs but these environments are different. Please check your environment.


python download-parti.py ./prompts/partiprompts_p2.jsonl

bash ./scripts/execute-enhance.sh

python ./scripts/fix-promptextend.py # merges base + extended -> <base+extended> format.
### Then you should have beautifulprompt.jsonl, promptist.jsonl, tipo_full.jsonl, and bloom_alibaba.jsonl, promptextend.jsonl in the prompts folder.
### Also promptextend-fixed.jsonl, we will use this instead. You can check the differences.

NUM_GPUS=4

bash ./scripts/execute-diffusion.sh sdxl 1024 ./prompts/promptdb.jsonl ./OUTPUTS/magicprompts $NUM_GPUS
bash ./scripts/execute-diffusion.sh cogview4 1024 ./prompts/promptdb.jsonl ./OUTPUTS/magicprompts $NUM_GPUS
bash ./scripts/execute-diffusion.sh sd15 512 ./prompts/promptdb.jsonl ./OUTPUTS/magicprompts $NUM_GPUS

bash ./scripts/execute-diffusion.sh sdxl 1024 ./prompts/promptextend-fixed.jsonl ./OUTPUTS/promptextend $NUM_GPUS
bash ./scripts/execute-diffusion.sh cogview4 1024 ./prompts/promptextend-fixed.jsonl ./OUTPUTS/promptextend $NUM_GPUS
bash ./scripts/execute-diffusion.sh sd15 512 ./prompts/promptextend-fixed.jsonl ./OUTPUTS/promptextend $NUM_GPUS


A=./prompts/promptist.jsonl
B=promptist

bash ./scripts/execute-diffusion.sh sdxl 1024 $A ./OUTPUTS/$B $NUM_GPUS
bash ./scripts/execute-diffusion.sh cogview4 1024 $A ./OUTPUTS/$B $NUM_GPUS
bash ./scripts/execute-diffusion.sh sd15 512 $A ./OUTPUTS/$B $NUM_GPUS

A=./prompts/tipo_full.jsonl 
B=tipo_full

bash ./scripts/execute-diffusion.sh sdxl 1024 $A ./OUTPUTS/$B $NUM_GPUS
bash ./scripts/execute-diffusion.sh cogview4 1024 $A ./OUTPUTS/$B $NUM_GPUS
bash ./scripts/execute-diffusion.sh sd15 512 $A ./OUTPUTS/$B $NUM_GPUS

A=./prompts/beautifulprompt.jsonl
B=bloom_alibaba
bash ./scripts/execute-diffusion.sh sdxl 1024 $A ./OUTPUTS/$B $NUM_GPUS
bash ./scripts/execute-diffusion.sh cogview4 1024 $A ./OUTPUTS/$B $NUM_GPUS
bash ./scripts/execute-diffusion.sh sd15 512 $A ./OUTPUTS/$B $NUM_GPUS
