risunobushi

config_single_layer_lora_flux

Sep 2nd, 2024
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 4.26 KB | None | 0 0
  1. ---
  2. job: extension
  3. config:
  4.  # this name will be the folder and filename name
  5.   name: "OUTPUT_FOLDER_NAME_target_specific_layers_version"
  6.   process:
  7.     - type: 'sd_trainer'
  8.       # root folder to save training sessions/samples/weights
  9.       training_folder: "output"
  10.       # uncomment to see performance stats in the terminal every N steps
  11. #      performance_log_every: 1000
  12.       device: cuda:0
  13.       # if a trigger word is specified, it will be added to captions of training data if it does not already exist
  14.       # alternatively, in your captions you can add [trigger] and it will be replaced with the trigger word
  15. #      trigger_word: "p3r5on"
  16.       network:
  17.         type: "lora"
  18.         linear: 128
  19.         linear_alpha: 128
  20.         dropout: 0.1
  21.         network_kwargs:
  22.           only_if_contains:
  23.            # strings in the lora module names
  24.             - "transformer.single_transformer_blocks.7.proj_out"
  25.             - "transformer.single_transformer_blocks.20.proj_out"
  26.       save:
  27.         dtype: float16 # precision to save
  28.         save_every: 50 # save every this many steps
  29.         max_step_saves_to_keep: 12 # how many intermittent saves to keep
  30.         push_to_hub: false #change this to True to push your trained model to Hugging Face.
  31.         # You can either set up a HF_TOKEN env variable or you'll be prompted to log-in        
  32. #       hf_repo_id: your-username/your-model-slug
  33. #       hf_private: true #whether the repo is private or public
  34.       datasets:
  35.        # datasets are a folder of images. captions need to be txt files with the same name as the image
  36.         # for instance image2.jpg and image2.txt. Only jpg, jpeg, and png are supported currently
  37.         # images will automatically be resized and bucketed into the resolution specified
  38.         # on windows, escape back slashes with another backslash so
  39.         # "C:\\path\\to\\images\\folder"
  40.         - folder_path: "path/to/dataset"
  41.           caption_ext: "txt"
  42.           caption_dropout_rate: 0.05  # will drop out the caption 5% of time
  43.           shuffle_tokens: false  # shuffle caption order, split by commas
  44.           cache_latents_to_disk: true  # leave this true unless you know what you're doing
  45.           resolution: [ 512 ]  # flux enjoys multiple resolutions
  46.       train:
  47.         batch_size: 1
  48.         steps: 800  # total number of steps to train 500 - 4000 is a good range
  49.         gradient_accumulation_steps: 1
  50.         train_unet: true
  51.         train_text_encoder: false  # probably won't work with flux
  52.         gradient_checkpointing: true  # need the on unless you have a ton of vram
  53.         noise_scheduler: "flowmatch" # for training only
  54.         optimizer: "adamw8bit"
  55.         lr: 3e-4
  56.         # uncomment this to skip the pre training sample
  57. #        skip_first_sample: true
  58.         # uncomment to completely disable sampling
  59. #        disable_sampling: true
  60.         # uncomment to use new vell curved weighting. Experimental but may produce better results
  61. #        linear_timesteps: true
  62.  
  63.         # ema will smooth out learning, but could slow it down. Recommended to leave on.
  64.         ema_config:
  65.           use_ema: true
  66.           ema_decay: 0.99
  67.  
  68.         # will probably need this if gpu supports it for flux, other dtypes may not work correctly
  69.         dtype: bf16
  70.       model:
  71.        # huggingface model name or path
  72.         name_or_path: "black-forest-labs/FLUX.1-dev"
  73.         is_flux: true
  74.         quantize: true  # run 8bit mixed precision
  75. #        low_vram: true  # uncomment this if the GPU is connected to your monitors. It will use less vram to quantize, but is slower.
  76.       sample:
  77.         sampler: "flowmatch" # must match train.noise_scheduler
  78.         sample_every: 50 # sample every this many steps
  79.         width: 1024
  80.         height: 1024
  81.         prompts:
  82.          # you can add [trigger] to the prompts here and it will be replaced with the trigger word
  83. #          - "[trigger] holding a sign that says 'I LOVE PROMPTS!'"\
  84.           - "photo portrait of NDR_BNI in central park"
  85.         neg: ""  # not used on flux
  86.         seed: 42
  87.         walk_seed: true
  88.         guidance_scale: 4
  89.         sample_steps: 20
  90. # you can add any additional meta info here. [name] is replaced with config name at top
  91. meta:
  92.   name: "[name]"
  93.   version: '1.0'
  94.  
Advertisement
Add Comment
Please, Sign In to add comment