Skip to content

Commit

Permalink
lora diary
Browse files Browse the repository at this point in the history
  • Loading branch information
huidehui committed Dec 12, 2024
1 parent e5ac095 commit b1adfee
Show file tree
Hide file tree
Showing 72 changed files with 354 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 84 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/sd-scripts.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions data-config/hxh4_deepdanbooru.toml
Original file line number Diff line number Diff line change
@@ -0,0 1,11 @@
[general]
enable_bucket = true # 是否使用Aspect Ratio Bucketing

[[datasets]]
resolution = 512 # 训练分辨率
batch_size = 8 # 批次大小

[[datasets.subsets]]
image_dir = '/kaggle/input/hxh-dataset/hxh/train_data' # 指定包含训练图像的文件夹
caption_extension = '.txt' # 若使用txt文件,更改此项
num_repeats = 10 # 训练图像的重复次数
11 changes: 11 additions & 0 deletions data-config/uscaption_deepdanbooru.toml
Original file line number Diff line number Diff line change
@@ -0,0 1,11 @@
[general]
enable_bucket = true # 是否使用Aspect Ratio Bucketing

[[datasets]]
resolution = 512 # 训练分辨率
batch_size = 8 # 批次大小

[[datasets.subsets]]
image_dir = '/kaggle/input/uscaption-dataset/uscaption/train_data' # 指定包含训练图像的文件夹
caption_extension = '.txt' # 若使用txt文件,更改此项
num_repeats = 10 # 训练图像的重复次数
Binary file added data/train_data_hxh/hxh-000.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/train_data_hxh/hxh-000.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
hxh4,solo,1boy, male_focus,realistic,black_hair, looking_at_viewer, portrait, lips,closed_mouth,bangs
Binary file added data/train_data_hxh/hxh-001.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/train_data_hxh/hxh-001.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
hxh4,solo,1boy, male_focus,realistic, black_hair, looking_at_viewer, portrait,lips,bangs
Binary file added data/train_data_hxh/hxh-002.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/train_data_hxh/hxh-002.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
hxh4,solo,1boy, male_focus,realistic, black_hair, looking_at_viewer, portrait,lips,bangs
Binary file added data/train_data_hxh/hxh-003.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/train_data_hxh/hxh-003.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
hxh4,solo,1boy, male_focus,realistic,black_hair, looking_at_viewer, portrait,lips,closed_mouth,bangs
Binary file added data/train_data_hxh/hxh-004.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/train_data_hxh/hxh-004.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
hxh4,solo,1boy, male_focus,realistic, black_hair, looking_at_viewer, portrait,lips,closed_mouth, short_hair,bangs
Binary file added data/train_data_hxh/hxh-005.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/train_data_hxh/hxh-005.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
hxh4,solo,1boy, male_focus,realistic,black_hair, looking_at_viewer, portrait,lips,closed_mouth, short_hair,bangs
Binary file added data/train_data_hxh/hxh-006.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/train_data_hxh/hxh-006.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
hxh4,solo,1boy, male_focus,realistic,black_hair,looking_at_viewer, portrait,lips,closed_mouth, short_hair,bangs
Binary file added data/train_data_hxh/hxh-007.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/train_data_hxh/hxh-007.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
hxh4,solo,1boy, male_focus,realistic,profile, upper_body,hair_ornament,black_hair
Binary file added data/train_data_hxh/hxh-008.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/train_data_hxh/hxh-008.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
hxh4,solo,1boy, male_focus,realistic, profile, upper_body,hair_ornament,black_hair
Binary file added data/train_data_uscaption/uscaotion-000.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/train_data_uscaption/uscaotion-000.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
1boy, male_focus, solo, manly, realistic, closed_mouth, upper_body
Binary file added data/train_data_uscaption/uscaotion-001.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/train_data_uscaption/uscaotion-001.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
helmet,realistic
Binary file added data/train_data_uscaption/uscaotion-002.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions data/train_data_uscaption/uscaotion-002.txt
Original file line number Diff line number Diff line change
@@ -0,0 1,2 @@
superhero outfit,star emblem,shield1boy, male_focus, solo, realistic, gloves,eyepatch,action stance

Binary file added data/train_data_uscaption/uscaotion-003.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/train_data_uscaption/uscaotion-003.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
solo, standing, male_focus, 1boy, realistic,belt,superhero outfit, star emblem, shield,gloves,heroic
Binary file added data/train_data_uscaption/uscaotion-004.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions data/train_data_uscaption/uscaotion-004.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
helmet,solo,upper body,profile, from_side,goggles, star emblem
2 changes: 1 addition & 1 deletion finetune/make_captions.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 203,7 @@ def setup_parser() -> argparse.ArgumentParser:

args = parser.parse_args()

# スペルミスしていたオプションを復元する
#
if args.caption_extention is not None:
args.caption_extension = args.caption_extention

Expand Down
29 changes: 29 additions & 0 deletions finetune/meta_cap.json
Original file line number Diff line number Diff line change
@@ -0,0 1,29 @@
{
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-000.jpg": {
"caption": "a male in a black shirt is staring at the camera"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-001.jpg": {
"caption": "a young man wearing a black jacket, looking away from the camera"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-002.jpg": {
"caption": "a man with black shirt and jacket on in a photo"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-003.jpg": {
"caption": "a person with dark hair and black shirt"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-004.jpg": {
"caption": "a man posing for a photo on a white surface"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-005.jpg": {
"caption": "a man with a black shirt and jacket"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-006.jpg": {
"caption": "a young man with an black shirt and jacket"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-007.jpg": {
"caption": "a man in a suit sitting down looking at his phone"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-008.jpg": {
"caption": "a man with short black hair standing up and looking at the side"
}
}
38 changes: 38 additions & 0 deletions finetune/meta_cap_dd.json
Original file line number Diff line number Diff line change
@@ -0,0 1,38 @@
{
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-000.jpg": {
"caption": "a male in a black shirt is staring at the camera",
"tags": "solo, male_focus, 1boy, black_hair, looking_at_viewer, portrait, lips, realistic,closed_mouth,bangs"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-001.jpg": {
"caption": "a young man wearing a black jacket, looking away from the camera",
"tags": "solo, male_focus, black_hair, looking_at_viewer, portrait,1boy, realistic,lips,bangs"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-002.jpg": {
"caption": "a man with black shirt and jacket on in a photo",
"tags": "solo, male_focus, black_hair, looking_at_viewer, portrait,1boy, realistic,lips,bangs"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-003.jpg": {
"caption": "a person with dark hair and black shirt",
"tags": "solo, male_focus, black_hair, looking_at_viewer, portrait,1boy, realistic,lips,closed_mouth,bangs"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-004.jpg": {
"caption": "a man posing for a photo on a white surface",
"tags": "solo, male_focus, black_hair, looking_at_viewer, portrait,1boy, realistic,lips,closed_mouth, short_hair,bangs"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-005.jpg": {
"caption": "a man with a black shirt and jacket",
"tags": "solo, male_focus, black_hair, looking_at_viewer, portrait,1boy, realistic,lips,closed_mouth, short_hair,bangs"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-006.jpg": {
"caption": "a young man with an black shirt and jacket",
"tags": "solo, male_focus,black_hair,looking_at_viewer, portrait,1boy, realistic,lips,closed_mouth, short_hair,bangs"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-007.jpg": {
"caption": "a man in a suit sitting down looking at his phone",
"tags": "male_focus, 1boy, solo, profile, upper_body,hair_ornament,black_hair"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-008.jpg": {
"caption": "a man with short black hair standing up and looking at the side",
"tags": "male_focus, 1boy, solo, profile, upper_body,hair_ornament,black_hair"
}
}
38 changes: 38 additions & 0 deletions finetune/meta_clean.json
Original file line number Diff line number Diff line change
@@ -0,0 1,38 @@
{
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-000.jpg": {
"caption": "a male in a black shirt is staring at the camera",
"tags": "solo, male focus, 1boy, black hair, looking at viewer, portrait, lips, realistic,closed mouth,bangs"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-001.jpg": {
"caption": "a man wearing a black jacket, looking away from the camera",
"tags": "solo, male focus, black hair, looking at viewer, portrait,1boy, realistic,lips,bangs"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-002.jpg": {
"caption": "a man with black shirt and jacket on in a photo",
"tags": "solo, male focus, black hair, looking at viewer, portrait,1boy, realistic,lips,bangs"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-003.jpg": {
"caption": "a girl with dark hair and black shirt",
"tags": "solo, male focus, black hair, looking at viewer, portrait,1boy, realistic,lips,closed mouth,bangs"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-004.jpg": {
"caption": "a man posing for a photo on a white surface",
"tags": "solo, male focus, black hair, looking at viewer, portrait,1boy, realistic,lips,closed mouth, short hair,bangs"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-005.jpg": {
"caption": "a man with a black shirt and jacket",
"tags": "solo, male focus, black hair, looking at viewer, portrait,1boy, realistic,lips,closed mouth, short hair,bangs"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-006.jpg": {
"caption": "a man with an black shirt and jacket",
"tags": "solo, male focus,black hair,looking at viewer, portrait,1boy, realistic,lips,closed mouth, short hair,bangs"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-007.jpg": {
"caption": "a man in a suit sitting down looking at his phone",
"tags": "male focus, 1boy, solo, profile, upper body,hair ornament,black hair"
},
"D:\\Probject\\SD\\sd-scripts\\finetune\\train_data\\hxh-008.jpg": {
"caption": "a man with short black hair standing up and looking at the side",
"tags": "male focus, 1boy, solo, profile, upper body,hair ornament,black hair"
}
}
5 changes: 5 additions & 0 deletions finetune/train.sh
Original file line number Diff line number Diff line change
@@ -0,0 1,5 @@
python make_captions.py --batch_size 4 "D:\Probject\SD\sd-scripts\finetune\train_data"

python merge_captions_to_metadata.py --full_path "D:\Probject\SD\sd-scripts\finetune\train_data" meta_cap.json

python merge_dd_tags_to_metadata.py --full_path "D:\Probject\SD\sd-scripts\finetune\train_data" --in_json meta_cap.json meta_cap_dd.json
1 change: 1 addition & 0 deletions finetune/train_data/hxh-000.caption
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
a male in a black shirt is staring at the camera
Binary file added finetune/train_data/hxh-000.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions finetune/train_data/hxh-000.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
solo, male_focus, 1boy, black_hair, looking_at_viewer, portrait, lips, realistic,closed_mouth,bangs
1 change: 1 addition & 0 deletions finetune/train_data/hxh-001.caption
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
a young man wearing a black jacket, looking away from the camera
Binary file added finetune/train_data/hxh-001.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions finetune/train_data/hxh-001.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
solo, male_focus, black_hair, looking_at_viewer, portrait,1boy, realistic,lips,bangs
1 change: 1 addition & 0 deletions finetune/train_data/hxh-002.caption
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
a man with black shirt and jacket on in a photo
Binary file added finetune/train_data/hxh-002.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions finetune/train_data/hxh-002.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
solo, male_focus, black_hair, looking_at_viewer, portrait,1boy, realistic,lips,bangs
1 change: 1 addition & 0 deletions finetune/train_data/hxh-003.caption
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
a person with dark hair and black shirt
Binary file added finetune/train_data/hxh-003.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions finetune/train_data/hxh-003.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
solo, male_focus, black_hair, looking_at_viewer, portrait,1boy, realistic,lips,closed_mouth,bangs
1 change: 1 addition & 0 deletions finetune/train_data/hxh-004.caption
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
a man posing for a photo on a white surface
Binary file added finetune/train_data/hxh-004.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions finetune/train_data/hxh-004.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
solo, male_focus, black_hair, looking_at_viewer, portrait,1boy, realistic,lips,closed_mouth, short_hair,bangs
1 change: 1 addition & 0 deletions finetune/train_data/hxh-005.caption
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
a man with a black shirt and jacket
Binary file added finetune/train_data/hxh-005.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions finetune/train_data/hxh-005.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
solo, male_focus, black_hair, looking_at_viewer, portrait,1boy, realistic,lips,closed_mouth, short_hair,bangs
1 change: 1 addition & 0 deletions finetune/train_data/hxh-006.caption
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
a young man with an black shirt and jacket
Binary file added finetune/train_data/hxh-006.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions finetune/train_data/hxh-006.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
solo, male_focus,black_hair,looking_at_viewer, portrait,1boy, realistic,lips,closed_mouth, short_hair,bangs
1 change: 1 addition & 0 deletions finetune/train_data/hxh-007.caption
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
a man in a suit sitting down looking at his phone
Binary file added finetune/train_data/hxh-007.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions finetune/train_data/hxh-007.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
male_focus, 1boy, solo, profile, upper_body,hair_ornament,black_hair
1 change: 1 addition & 0 deletions finetune/train_data/hxh-008.caption
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
a man with short black hair standing up and looking at the side
Binary file added finetune/train_data/hxh-008.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions finetune/train_data/hxh-008.txt
Original file line number Diff line number Diff line change
@@ -0,0 1 @@
male_focus, 1boy, solo, profile, upper_body,hair_ornament,black_hair
Loading

0 comments on commit b1adfee

Please sign in to comment.