Views
No views yet
safetensors weights and a model.safetensors.index.json file.Adrien_Brody, Bo, Butin, Chandler, Coco, Furina, Gao_Qiqiang, Hermione, Ichihime, Joey, Leonardo, Mam, Miki_Nikaidou, Mydieu, Pikachu, Rin_Tohsaka, Saber, Will_In_Vietnam, Wukong, YuiYagi1from inference import create_unicharacter_inference
2from pathlib import Path
3
4# Initialize the unified inference (modify paths according to your environment)
5inference = create_unicharacter_inference(
6 model_path="models/BAGEL-7B-MoT",
7 checkpoint_path="<checkpoint_path>",
8 vit_checkpoint_path="<vit_checkpoint_path>",
9 max_mem_per_gpu="40GiB",
10 seed=42,
11)
12
13out_dir = Path("test_images/outputs")
14out_dir.mkdir(parents=True, exist_ok=True)
15
16# 1) Text-to-image generation (Role T2I)
17res = inference.generate_image("Ichihime chasing a butterfly")
18res["image"].save(out_dir / "t2i_ichihime.png")
19
20# 2) Visual understanding / VQA
21res = inference.visual_understanding(
22 "data/personalized_data/train/Mahjong Soul-Ichihime/1.png",
23 "What's the color of Ichihime's hair?",
24)
25print("VQA:", res["text"])
26
27# 3) Knowledge QA
28res = inference.knowledge_qa("When do you born?")
29print("Knowledge QA:", res["text"])
30
31# 4) Multimodal role-play
32res = inference.role_play(
33 character_name="Ichihime",
34 description="",
35 opening="",
36 user_text="Hi, Ichihime. How are you?",
37)
38print("Role-play:", res["response"])huggingface-cli download Tangc03/UniCharacter --local-dir UniCharacterhuggingface-cli download Tangc03/UniCharacter --include "Hermione/*" --local-dir UniCharacter1@article{tang2026towards,
2 title={Towards Customized Multimodal Role-Play},
3 author={Tang, Chao and Wu, Jianzong and Shi, Qingyu and Tian, Ye and Zhang, Aixi and Jiang, Hao and Zhang, Jiangning and Tong, Yunhai},
4 journal={arXiv preprint arXiv:2605.08129},
5 year={2026}
6}