update assets
BIN
assets/sects - 副本/冥王宗.png
Normal file
|
After Width: | Height: | Size: 165 KiB |
BIN
assets/sects - 副本/千帆城.png
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
assets/sects - 副本/合欢宗.png
Normal file
|
After Width: | Height: | Size: 189 KiB |
BIN
assets/sects - 副本/幽魂噬影宗.png
Normal file
|
After Width: | Height: | Size: 157 KiB |
BIN
assets/sects - 副本/明心剑宗.png
Normal file
|
After Width: | Height: | Size: 173 KiB |
BIN
assets/sects - 副本/朱勾宗.png
Normal file
|
After Width: | Height: | Size: 184 KiB |
BIN
assets/sects - 副本/水镜宗.png
Normal file
|
After Width: | Height: | Size: 165 KiB |
BIN
assets/sects - 副本/百兽宗.png
Normal file
|
After Width: | Height: | Size: 185 KiB |
BIN
assets/sects - 副本/镇魂宗.png
Normal file
|
After Width: | Height: | Size: 172 KiB |
|
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 330 KiB |
|
Before Width: | Height: | Size: 188 KiB After Width: | Height: | Size: 344 KiB |
|
Before Width: | Height: | Size: 189 KiB After Width: | Height: | Size: 275 KiB |
|
Before Width: | Height: | Size: 157 KiB After Width: | Height: | Size: 346 KiB |
|
Before Width: | Height: | Size: 173 KiB After Width: | Height: | Size: 318 KiB |
|
Before Width: | Height: | Size: 184 KiB After Width: | Height: | Size: 372 KiB |
|
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 323 KiB |
|
Before Width: | Height: | Size: 185 KiB After Width: | Height: | Size: 352 KiB |
|
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 345 KiB |
@@ -1,6 +1,6 @@
|
||||
id,name,desc,member_act_style,alignment,sect_surnames,male_sect_given_names,female_sect_given_names,weight,effects
|
||||
,,宗门名称与描述,宗门成员行事风格,阵营(正/中/邪),宗门常用姓氏(分号分隔),男性常用名(分号分隔),女性常用名(分号分隔),权重(默认1),effects(JSON)
|
||||
1,明心剑宗,通玄界东方第一宗,以无上剑道称雄于世。云纹禁制为不传心法。,清明克己,行止如一。重剑与心法并重,讲究明心见性。,正,明;心;剑;霄;玄;霁;衡;孤;徽;肃,澄川;宏石;磐岳;霆岱;寂岚;久安;宸秋;烁离;沧岳;砺锋;炎洲;远歌,采微;霏岚;韶华;绮澜;珠影;远岫;若水;凝香;雪瑶;南絮;轻萝;宛竹,1000,
|
||||
1,明心剑宗,通玄界东方第一宗,以无上剑道称雄于世。云纹禁制为不传心法。,清明克己,行止如一。重剑与心法并重,讲究明心见性。,正,明;心;剑;霄;玄;霁;衡;孤;徽;肃,澄川;宏石;磐岳;霆岱;寂岚;久安;宸秋;烁离;沧岳;砺锋;炎洲;远歌,采微;霏岚;韶华;绮澜;珠影;远岫;若水;凝香;雪瑶;南絮;轻萝;宛竹,1,
|
||||
2,百兽宗,以驯养灵兽闻名,豢养各种妖兽灵怪为战力。,你言语直接,重视力量与血性,崇尚狩猎与搏斗。,邪,,驼王;飞熊;虎魄;狼行;熊罡;白猿;石坚;山岚;青鬃;玄爪;金瞳;裂爪;破角;狂鬃;赤鬣;苍隼;啸风;裂岩,狐绮;白貂;青翎;雪牙;赤羽;玄狸;灵爪;月狐;银鳞;霜蹄;云貉;绒尾;锦狐;轻蹄,1,
|
||||
3,水镜宗,正道十宗之一,实则严守中立。拥有仙界异宝"彻天水镜"可预知未来。,你处事冷静圆融,喜以柔克刚,擅借力与反制。,中,水;镜;寒;霜;冰;清;沐;澜;渊;泉,涟光;沧浪;泽远;浩川;泊舟;涓石;溪原;涵舟;泠曜;漪岑;淞岳;涔雨,漫霖;洛漪;潋月;涵烟;沁波;翠波;漫葭;汀兰;潭歌;涓玥;澧宁;潇然,1,
|
||||
4,冥王宗,行走幽冥之道,术法阴冷狠厉。,你言辞冷厉少情,敬畏因果而不惧杀伐,偏向效率与结果。,邪,冥;王;玄;幽;夜;白;冷;狱;魇;阴,血燎;焚魄;灰灭;殁川;绝尘;厌离;朔寒;邪风;归墟;朽骨;朔月;止戈,寒绫;霜瑶;凄歌;素鸢;祭宁;黛魂;夙梦;绫雪;凛珑;霁月;旷音;凝岚,1,
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 5 and column 73.
|
@@ -153,10 +153,24 @@ if __name__ == "__main__":
|
||||
"金棕长发,爽朗大笑,额前碎发,兽牙发簪。",
|
||||
"青黑短发,专注坚定,线条硬朗,细链发饰垂坠。",
|
||||
]
|
||||
|
||||
for affix in male_affixes:
|
||||
prompt_text = male_prompt_base + affix
|
||||
save_generated_image(prompt_text, folder="tools/img_gen/tmp/males")
|
||||
for affix in female_affixes:
|
||||
prompt_text = female_prompt_base + affix
|
||||
save_generated_image(prompt_text, folder="tools/img_gen/tmp/females")
|
||||
sect_prompt_base = "像素化的仙侠宗门场景图片,极度像素化,颗粒感强,线条轮廓粗,极简主义,二次元风格漫画图片。"
|
||||
sect_affixes = [
|
||||
"山巅飘渺云海,云纹禁制光芒环绕,远处群峰。",
|
||||
"灵兽栖地,兽栏密布,岩石兽穴。",
|
||||
"湖面倒影,中央悬浮巨大水镜,镜面波光粼粼,雾气弥漫。",
|
||||
"幽冥宗门,阴暗昏沉,黑雾弥漫,冷厉气息,幽蓝鬼火点点。",
|
||||
"炼器工坊,机关密布,熔炉火光。",
|
||||
"合欢宫殿,粉红雾气,花瓣飘舞,柔和光晕,纱幔轻垂。",
|
||||
"镇魂大殿,铁血肃杀,封印符文,镇压法阵,黑铁锁链。",
|
||||
"幽影之地,暗影重重,光影交错,幽冥之气,黑雾吞噬轮廓。",
|
||||
"船帆如云,炼器炉火。",
|
||||
]
|
||||
# for affix in male_affixes:
|
||||
# prompt_text = male_prompt_base + affix
|
||||
# save_generated_image(prompt_text, folder="tools/img_gen/tmp/males")
|
||||
# for affix in female_affixes:
|
||||
# prompt_text = female_prompt_base + affix
|
||||
# save_generated_image(prompt_text, folder="tools/img_gen/tmp/females")
|
||||
for i, affix in enumerate(sect_affixes):
|
||||
prompt_text = sect_prompt_base + affix
|
||||
save_generated_image(prompt_text, folder="tools/img_gen/tmp/sects")
|
||||
@@ -253,14 +253,89 @@ def process_all(
|
||||
|
||||
return saved_files
|
||||
|
||||
|
||||
def process_all_sects(
|
||||
input_dir: PathLike = "result",
|
||||
output_dir: PathLike = "processed",
|
||||
*,
|
||||
crop_fraction: float = 1 / 16,
|
||||
sect_names: list[str],
|
||||
show_progress: bool = True,
|
||||
resize_to: Optional[tuple[int, int]] = (512, 512),
|
||||
) -> list[Path]:
|
||||
"""
|
||||
批量处理门派图片:只裁剪边缘,不抠背景,使用指定名称命名。
|
||||
|
||||
Args:
|
||||
input_dir: 输入目录
|
||||
output_dir: 输出目录
|
||||
crop_fraction: 裁剪比例
|
||||
sect_names: 门派名称列表,按顺序对应输入文件
|
||||
show_progress: 是否显示批处理进度条
|
||||
resize_to: 调整图片尺寸,None表示不调整
|
||||
"""
|
||||
|
||||
input_path = Path(input_dir)
|
||||
output_path = Path(output_dir)
|
||||
output_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
allowed_suffixes = {".png", ".jpg", ".jpeg", ".webp", ".bmp"}
|
||||
files = [
|
||||
path
|
||||
for path in sorted(input_path.iterdir())
|
||||
if path.is_file() and path.suffix.lower() in allowed_suffixes
|
||||
]
|
||||
|
||||
iterator = tqdm(files, desc="Processing sect images") if show_progress else files
|
||||
saved_files: list[Path] = []
|
||||
|
||||
for index, file_path in enumerate(iterator):
|
||||
# 只裁剪边缘,不抠背景
|
||||
cropped = crop_inner_region(file_path, fraction=crop_fraction)
|
||||
|
||||
# 调整尺寸
|
||||
if resize_to is not None:
|
||||
cropped = cropped.resize(resize_to, Image.Resampling.LANCZOS)
|
||||
|
||||
# 使用门派名称命名
|
||||
if index < len(sect_names):
|
||||
output_name = f"{sect_names[index]}.png"
|
||||
else:
|
||||
# 如果名称列表不够,使用原文件名
|
||||
output_name = file_path.name
|
||||
|
||||
output_file = output_path / output_name
|
||||
cropped.save(output_file)
|
||||
saved_files.append(output_file)
|
||||
|
||||
return saved_files
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
process_all(
|
||||
input_dir="tools/img_gen/tmp/males",
|
||||
output_dir="tools/img_gen/tmp/processed_males",
|
||||
crop_fraction=1 / 16,
|
||||
)
|
||||
process_all(
|
||||
input_dir="tools/img_gen/tmp/females",
|
||||
output_dir="tools/img_gen/tmp/processed_females",
|
||||
# process_all(
|
||||
# input_dir="tools/img_gen/tmp/males",
|
||||
# output_dir="tools/img_gen/tmp/processed_males",
|
||||
# crop_fraction=1 / 16,
|
||||
# )
|
||||
# process_all(
|
||||
# input_dir="tools/img_gen/tmp/females",
|
||||
# output_dir="tools/img_gen/tmp/processed_females",
|
||||
# crop_fraction=1 / 16,
|
||||
# )
|
||||
sect_names = [
|
||||
"明心剑宗",
|
||||
"百兽宗",
|
||||
"水镜宗",
|
||||
"冥王宗",
|
||||
"朱勾宗",
|
||||
"合欢宗",
|
||||
"镇魂宗",
|
||||
"幽魂噬影宗",
|
||||
"千帆城",
|
||||
]
|
||||
process_all_sects(
|
||||
input_dir="tools/img_gen/tmp/sects",
|
||||
output_dir="tools/img_gen/tmp/processed_sects",
|
||||
crop_fraction=1 / 16,
|
||||
sect_names=sect_names,
|
||||
)
|
||||