zhangyang-0123's picture
Update README.md
c636e11 verified
---
tags:
- text-to-image
- lora
- adapter
- hunyuanimage-3.0
widget:
- output:
url: images/image_0.png
text: Astronaut riding horse on moon in naruto style.
- output:
url: images/image_1.png
text: Orange building corner with shadows in naruto style.
- output:
url: images/image_2.png
text: Asian woman in red velvet chair in naruto style.
- output:
url: images/image_3.png
text: An image of bill gates in a black shirt in naruto style.
- output:
url: images/image_4.png
text: An astronaut riding a rainbow unicorn on the moon in naruto style.
- output:
url: images/image_5.png
text: Four rabbits in different colors in naruto style.
base_model: tencent/HunyuanImage-3.0
base_model_relation: adapter
instance_prompt: in naruto style.
datasets:
- lambdalabs/naruto-blip-captions
language:
- en
license: other
license_name: tencent-hunyuan-community
license_link: https://huggingface.co/tencent/HunyuanImage-3.0/blob/main/LICENSE
extra_gated_prompt: >
This adapter is a Model Derivative of tencent/HunyuanImage-3.0 and is
distributed under the Tencent Hunyuan Community License Agreement. By
requesting access, you confirm that:
• You will use it only for non-commercial research or personal use;
• You will respect third-party IP rights;
• You will not use the model to create harmful or NSFW content;
• You are not located in the EU, UK, or South Korea.
extra_gated_fields:
I agree to use this model for non-commercial use ONLY: checkbox
I confirm I am not located in the EU, UK, or South Korea: checkbox
library_name: adapter-transformers
---
# HunyuanImage-3.0-Naruto-Style-Adapter
<Gallery />
## Trigger words
You should use `in naruto style.` at the **end of the prompt** to trigger the image generation.
## Training
We use [this repo](https://github.com/PhotonAISG/hunyuan-image3-finetune) for training.
## License
This adapter is a Model Derivative of [tencent/HunyuanImage-3.0](https://huggingface.co/tencent/HunyuanImage-3.0)
and is distributed under the **Tencent Hunyuan Community License Agreement**.
Use of these weights must comply with the Tencent Hunyuan Community License and its
territorial and usage restrictions. See the [LICENSE](./LICENSE) and [NOTICE](./NOTICE)
files in this repository for details.
This project is **not affiliated with, associated with, sponsored by, or endorsed by Tencent**.
## Usage and Restrictions
- This model/adapter is provided for **non-commercial research and personal use only**.
Commercial use (including using the model or its outputs in a paid product, service, or large-scale deployment) is **not permitted** without obtaining appropriate permissions and verifying all relevant rights.
- Users **must** comply with:
- The **Tencent Hunyuan Community License Agreement** (including territory and acceptable-use limitations).
- Any applicable copyright, trademark, and other IP rights in the **Naruto** franchise and any other third-party content.
- You are solely responsible for ensuring that your use of this adapter and any generated outputs respects third-party IP and applicable laws in your jurisdiction.
---
## Model Details
### Model Description
- **Developed by:** Pixo
- **Model type:** LoRA/adapter for style transfer
- **License:** Tencent Hunyuan Community License Agreement
- **Finetuned from model:** tencent/HunyuanImage-3.0
- **Language(s):** English prompts
### Dataset
This model uses the **Naruto BLIP captions** dataset.
The dataset authors provide the following citation:
```bibtex
@misc{cervenka2022naruto2,
author = {Cervenka, Eole},
title = {Naruto BLIP captions},
year={2022},
howpublished= {\url{https://huggingface.co/datasets/lambdalabs/naruto-blip-captions/}}
}
```
## Uses
### Direct Use
- Apply a Naruto-style anime aesthetic to images generated by HunyuanImage-3.0.
- Use by loading the base model and applying this adapter.
- Trigger phrase: `in naruto style.` (must be at the end)
### Out-of-Scope Use
- Harmful, deceptive, or NSFW content.
- Any use that violates the Tencent Hunyuan Community License Agreement.
- Any use that infringes third-party IP (including *Naruto* and other copyrighted characters).
- Commercial use of the model or its outputs.
## Bias, Risks, and Limitations
- Trained on a small amount of images, so the style may overfit.
- May distort anatomy or realism on complex subjects.
- Style is intentionally exaggerated in anime fashion.
## How to Get Started with the Model
1️⃣ **Download and clone the HunyuanImage-3.0 repo**
```bash
git clone https://github.com/Tencent-Hunyuan/HunyuanImage-3.0.git
cd HunyuanImage-3.0/
# Download base model
hf download tencent/HunyuanImage-3.0 --local-dir ./HunyuanImage-3
```
2️⃣ **Download the adapter**
```bash
# Download from HuggingFace
hf download pixosg/HunyuanImage-3.0-Naruto-Style-Adapter --local-dir ./hunyuanimage-3-naruto-style-adapter
```
3️⃣ **Load the base model and adapter**
```python
from peft import PeftModel
from hunyuan_image_3.hunyuan import HunyuanImage3ForCausalMM
import torch
model_id = "./HunyuanImage-3"
adapter_model_path = "./hunyuanimage-3-naruto-style-adapter"
kwargs = dict(
attn_implementation="sdpa", # Use "flash_attention_2" if FlashAttention is installed
trust_remote_code=True,
dtype=torch.bfloat16,
device_map="auto",
moe_impl="eager",
moe_drop_tokens=True,
)
model = HunyuanImage3ForCausalMM.from_pretrained(model_id, **kwargs)
model.load_tokenizer(model_id)
# Option 1
model.load_adapter(adapter_model_path)
# Option 2
model.get_input_embeddings = lambda: model.model.wte
model.set_input_embeddings = lambda value: setattr(model.model, 'wte', value)
model = PeftModel.from_pretrained(model, adapter_model_path, trust_remote_code=True)
# Generate image
prompt = "Astronaut riding horse on moon in naruto style."
image = model.generate_image(prompt=prompt, stream=True)
image.save("image.png")
```