Codes of vision parts in Conditional LoRA Parameter Generation.
export WANDB_API_KEY="Set your wandb key here"
cd PixArt-StyleTrans-CompModify trainLoRA.sh
You need to confirm the following arguments:
- pretrained_model_name_or_path: path to your PixArt-XL-256 model.
- dataset_name: a folder filled with images and the name of the image files are prompts.
- output_dir: a path to save the output of LoRA parameters. It follows a rule lora_result_{style_class}_{param_group}.
sh trainLoRA.shModify constructLoRA.py
You need to confirm the following arguments:
- style_class: the style_class in lora_result_{style_class}_{param_group}.
- param_group: the param_group in lora_result_{style_class}_{param_group}.
python constructLoRA.pyNow, you should have got a LoRA parameter dataset folder: CheckpointTrainLoRA.
Train AE.
Modify trainVAE-Transfer.py
You need to confirm the following arguments:
- image_data_path: path to your image dataset which is used as condition.
- lora_data_path: path to your
CheckpointTrainLoRA. - result_save_path: path to save your AE checkpoint.
cd ../CondiPDiff
python trainVAE-Transfer.py
python evaluateVAE-Transfer.pyTrain Latent Diffusion.
Modify trainDDPM-Transfer.py
You need to confirm the following arguments:
- image_data_path: path to your image dataset which is used as condition.
- lora_data_path: path to your
CheckpointTrainLoRA. - vae_checkpoint_path: path to your AE checkpoint.
- result_save_path: path to save your Diffusion checkpoint.
python trainDDPM-Transfer.py
python evaluateDDPM-Transfer.pyThe tag: Transfer refers to StyleTrans-Comp, which verified the conditional generation ability.
The tag: Continue refers to StyleTrans-Conti, which verified the in-set generalization ability.
The tag: Classify refers to Classify-CIFAR10, which is an experiment for conditional generation by image class.
The example above showed the usage of tag Transfer, the others follow a similar method to use.