Upload mykontext.yaml
Browse files- mykontext.yaml +102 -0
mykontext.yaml
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
job: extension
|
| 3 |
+
config:
|
| 4 |
+
# this name will be the folder and filename name
|
| 5 |
+
name: "xjt_my_first_flux_kontext_lora_v1"
|
| 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: 16
|
| 19 |
+
linear_alpha: 16
|
| 20 |
+
save:
|
| 21 |
+
dtype: float16 # precision to save
|
| 22 |
+
save_every: 250 # save every this many steps
|
| 23 |
+
max_step_saves_to_keep: 4 # how many intermittent saves to keep
|
| 24 |
+
push_to_hub: false #change this to True to push your trained model to Hugging Face.
|
| 25 |
+
# You can either set up a HF_TOKEN env variable or you'll be prompted to log-in
|
| 26 |
+
# hf_repo_id: your-username/your-model-slug
|
| 27 |
+
# hf_private: true #whether the repo is private or public
|
| 28 |
+
datasets:
|
| 29 |
+
# datasets are a folder of images. captions need to be txt files with the same name as the image
|
| 30 |
+
# for instance image2.jpg and image2.txt. Only jpg, jpeg, and png are supported currently
|
| 31 |
+
# images will automatically be resized and bucketed into the resolution specified
|
| 32 |
+
# on windows, escape back slashes with another backslash so
|
| 33 |
+
# "C:\\path\\to\\images\\folder"
|
| 34 |
+
- folder_path: "/app/datasets/superman_target"
|
| 35 |
+
# control path is the input images for kontext for a paired dataset. These are the source images you want to change.
|
| 36 |
+
# You can comment this out and only use normal images if you don't have a paired dataset.
|
| 37 |
+
# Control images need to match the filenames on the folder path but in
|
| 38 |
+
# a different folder. These do not need captions.
|
| 39 |
+
control_path: "/app/datasets/superman_control"
|
| 40 |
+
caption_ext: "txt"
|
| 41 |
+
caption_dropout_rate: 0.05 # will drop out the caption 5% of time
|
| 42 |
+
shuffle_tokens: false # shuffle caption order, split by commas
|
| 43 |
+
cache_latents_to_disk: true # leave this true unless you know what you're doing
|
| 44 |
+
# Kontext runs images in at 2x the latent size. It may OOM at 1024 resolution with 24GB vram.
|
| 45 |
+
resolution: [ 512, 768 ] # flux enjoys multiple resolutions
|
| 46 |
+
# resolution: [ 512, 768, 1024 ]
|
| 47 |
+
train:
|
| 48 |
+
batch_size: 1
|
| 49 |
+
steps: 3000 # total number of steps to train 500 - 4000 is a good range
|
| 50 |
+
gradient_accumulation_steps: 1
|
| 51 |
+
train_unet: true
|
| 52 |
+
train_text_encoder: false # probably won't work with flux
|
| 53 |
+
gradient_checkpointing: true # need the on unless you have a ton of vram
|
| 54 |
+
noise_scheduler: "flowmatch" # for training only
|
| 55 |
+
optimizer: "adamw8bit"
|
| 56 |
+
lr: 1e-4
|
| 57 |
+
timestep_type: "weighted" # sigmoid, linear, or weighted.
|
| 58 |
+
# uncomment this to skip the pre training sample
|
| 59 |
+
# skip_first_sample: true
|
| 60 |
+
# uncomment to completely disable sampling
|
| 61 |
+
# disable_sampling: true
|
| 62 |
+
|
| 63 |
+
# ema will smooth out learning, but could slow it down.
|
| 64 |
+
|
| 65 |
+
# ema_config:
|
| 66 |
+
# use_ema: true
|
| 67 |
+
# ema_decay: 0.99
|
| 68 |
+
|
| 69 |
+
# will probably need this if gpu supports it for flux, other dtypes may not work correctly
|
| 70 |
+
dtype: bf16
|
| 71 |
+
model:
|
| 72 |
+
# huggingface model name or path. This model is gated.
|
| 73 |
+
# visit https://huggingface.co/black-forest-labs/FLUX.1-Kontext-dev to accept the terms and conditions
|
| 74 |
+
# and then you can use this model.
|
| 75 |
+
name_or_path: "black-forest-labs/FLUX.1-Kontext-dev"
|
| 76 |
+
arch: "flux_kontext"
|
| 77 |
+
quantize: true # run 8bit mixed precision
|
| 78 |
+
# low_vram: true # uncomment this if the GPU is connected to your monitors. It will use less vram to quantize, but is slower.
|
| 79 |
+
sample:
|
| 80 |
+
sampler: "flowmatch" # must match train.noise_scheduler
|
| 81 |
+
sample_every: 250 # sample every this many steps
|
| 82 |
+
width: 1024
|
| 83 |
+
height: 1024
|
| 84 |
+
prompts:
|
| 85 |
+
# you can add [trigger] to the prompts here and it will be replaced with the trigger word
|
| 86 |
+
# the --ctrl_img path is the one loaded to apply the kontext editing to
|
| 87 |
+
# - "[trigger] holding a sign that says 'I LOVE PROMPTS!'"\
|
| 88 |
+
- "Maintain the subject original pose exactly as shown in the reference image. Do not change the position of the arms, legs, head, or body. all posture and movement must remain fully consistent with the original. Add a flowing red cape draped naturally over the shoulders, extending behind the back with realistic gravity and folds. Enhance muscular definition specifically in the arms and legs, emphasizing strength, athleticism, and physical power in the limbs. Muscles should appear well-developed and anatomically realistic, while maintaining the subject natural proportions. Do not enhance or expose musculature on the torso or chest unless it is fully covered by clothing. The upper body must remain clothed, and no nipples or bare skin on the torso should be visible under any circumstances. Ensure the subject is fully dressed. Clothing must appropriately cover the torso and lower body. Skin texture on visible areas (such as face, hands, arms, and legs) should remain natural and realistic.Preserve the subject facial features, hairstyle, clothing style, and skin tone. The person must remain clearly recognizable. Do not change the background, lighting, or any other elements of the scene. Only enhance limb muscle definition and add the red cape—without altering the subject pose, expression, outfit, or environment.Enhance image clarity and sharpness. Improve fine details, texture, and definition while preserving the original composition, lighting, and color balance. --ctrl_img /app/datasets/superman_test/nan1.jpg"
|
| 89 |
+
- "Maintain the subject original pose exactly as shown in the reference image. Do not change the position of the arms, legs, head, or body. all posture and movement must remain fully consistent with the original. Add a flowing red cape draped naturally over the shoulders, extending behind the back with realistic gravity and folds. Enhance muscular definition specifically in the arms and legs, emphasizing strength, athleticism, and physical power in the limbs. Muscles should appear well-developed and anatomically realistic, while maintaining the subject natural proportions. Do not enhance or expose musculature on the torso or chest unless it is fully covered by clothing. The upper body must remain clothed, and no nipples or bare skin on the torso should be visible under any circumstances. Ensure the subject is fully dressed. Clothing must appropriately cover the torso and lower body. Skin texture on visible areas (such as face, hands, arms, and legs) should remain natural and realistic.Preserve the subject facial features, hairstyle, clothing style, and skin tone. The person must remain clearly recognizable. Do not change the background, lighting, or any other elements of the scene. Only enhance limb muscle definition and add the red cape—without altering the subject pose, expression, outfit, or environment.Enhance image clarity and sharpness. Improve fine details, texture, and definition while preserving the original composition, lighting, and color balance. --ctrl_img /app/datasets/superman_test/nan2.jpg"
|
| 90 |
+
- "Maintain the subject original pose exactly as shown in the reference image. Do not change the position of the arms, legs, head, or body. all posture and movement must remain fully consistent with the original. Add a flowing red cape draped naturally over the shoulders, extending behind the back with realistic gravity and folds. Enhance muscular definition specifically in the arms and legs, emphasizing strength, athleticism, and physical power in the limbs. Muscles should appear well-developed and anatomically realistic, while maintaining the subject natural proportions. Do not enhance or expose musculature on the torso or chest unless it is fully covered by clothing. The upper body must remain clothed, and no nipples or bare skin on the torso should be visible under any circumstances. Ensure the subject is fully dressed. Clothing must appropriately cover the torso and lower body. Skin texture on visible areas (such as face, hands, arms, and legs) should remain natural and realistic.Preserve the subject facial features, hairstyle, clothing style, and skin tone. The person must remain clearly recognizable. Do not change the background, lighting, or any other elements of the scene. Only enhance limb muscle definition and add the red cape—without altering the subject pose, expression, outfit, or environment.Enhance image clarity and sharpness. Improve fine details, texture, and definition while preserving the original composition, lighting, and color balance. --ctrl_img /app/datasets/superman_test/nan3.jpg"
|
| 91 |
+
- "Maintain the subject original pose exactly as shown in the reference image. Do not change the position of the arms, legs, head, or body. all posture and movement must remain fully consistent with the original. Add a flowing red cape draped naturally over the shoulders, extending behind the back with realistic gravity and folds. Enhance muscular definition specifically in the arms and legs, emphasizing strength, athleticism, and physical power in the limbs. Muscles should appear well-developed and anatomically realistic, while maintaining the subject natural proportions. Do not enhance or expose musculature on the torso or chest unless it is fully covered by clothing. The upper body must remain clothed, and no nipples or bare skin on the torso should be visible under any circumstances. Ensure the subject is fully dressed. Clothing must appropriately cover the torso and lower body. Skin texture on visible areas (such as face, hands, arms, and legs) should remain natural and realistic.Preserve the subject facial features, hairstyle, clothing style, and skin tone. The person must remain clearly recognizable. Do not change the background, lighting, or any other elements of the scene. Only enhance limb muscle definition and add the red cape—without altering the subject pose, expression, outfit, or environment.Enhance image clarity and sharpness. Improve fine details, texture, and definition while preserving the original composition, lighting, and color balance. --ctrl_img /app/datasets/superman_test/nan4.jpg"
|
| 92 |
+
- "Maintain the subject original pose exactly as shown in the reference image. Do not change the position of the arms, legs, head, or body. all posture and movement must remain fully consistent with the original. Add a flowing red cape draped naturally over the shoulders, extending behind the back with realistic gravity and folds. Enhance muscular definition specifically in the arms and legs, emphasizing strength, athleticism, and physical power in the limbs. Muscles should appear well-developed and anatomically realistic, while maintaining the subject natural proportions. Do not enhance or expose musculature on the torso or chest unless it is fully covered by clothing. The upper body must remain clothed, and no nipples or bare skin on the torso should be visible under any circumstances. Ensure the subject is fully dressed. Clothing must appropriately cover the torso and lower body. Skin texture on visible areas (such as face, hands, arms, and legs) should remain natural and realistic.Preserve the subject facial features, hairstyle, clothing style, and skin tone. The person must remain clearly recognizable. Do not change the background, lighting, or any other elements of the scene. Only enhance limb muscle definition and add the red cape—without altering the subject pose, expression, outfit, or environment.Enhance image clarity and sharpness. Improve fine details, texture, and definition while preserving the original composition, lighting, and color balance. --ctrl_img /app/datasets/superman_test/nan5.jpg"
|
| 93 |
+
- "Maintain the subject original pose exactly as shown in the reference image. Do not change the position of the arms, legs, head, or body. all posture and movement must remain fully consistent with the original. Add a flowing red cape draped naturally over the shoulders, extending behind the back with realistic gravity and folds. Enhance muscular definition specifically in the arms and legs, emphasizing strength, athleticism, and physical power in the limbs. Muscles should appear well-developed and anatomically realistic, while maintaining the subject natural proportions. Do not enhance or expose musculature on the torso or chest unless it is fully covered by clothing. The upper body must remain clothed, and no nipples or bare skin on the torso should be visible under any circumstances. Ensure the subject is fully dressed. Clothing must appropriately cover the torso and lower body. Skin texture on visible areas (such as face, hands, arms, and legs) should remain natural and realistic.Preserve the subject facial features, hairstyle, clothing style, and skin tone. The person must remain clearly recognizable. Do not change the background, lighting, or any other elements of the scene. Only enhance limb muscle definition and add the red cape—without altering the subject pose, expression, outfit, or environment.Enhance image clarity and sharpness. Improve fine details, texture, and definition while preserving the original composition, lighting, and color balance. --ctrl_img /app/datasets/superman_test/nan6.jpg"
|
| 94 |
+
neg: "" # not used on flux
|
| 95 |
+
seed: 42
|
| 96 |
+
walk_seed: true
|
| 97 |
+
guidance_scale: 4
|
| 98 |
+
sample_steps: 20
|
| 99 |
+
# you can add any additional meta info here. [name] is replaced with config name at top
|
| 100 |
+
meta:
|
| 101 |
+
name: "[name]"
|
| 102 |
+
version: '1.0'
|