Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,70 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: peft
|
| 3 |
+
base_model: Tongyi-MAI/Z-Image-Turbo
|
| 4 |
+
tags:
|
| 5 |
+
- lora
|
| 6 |
+
- diffusion
|
| 7 |
+
- image-generation
|
| 8 |
+
- japan
|
| 9 |
+
- photography
|
| 10 |
+
- realistic
|
| 11 |
+
license: other
|
| 12 |
+
datasets:
|
| 13 |
+
- ThePioneer/japanese-photos
|
| 14 |
+
language:
|
| 15 |
+
- en
|
| 16 |
+
- fr
|
| 17 |
+
pipeline_tag: text-to-image
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# Japan Realistic LoRA for Z-Image-Turbo
|
| 21 |
+
|
| 22 |
+
A LoRA adapter trained on realistic Japanese photography to enhance Z-Image-Turbo's ability to generate authentic Japanese scenes, urban landscapes, and cultural elements.
|
| 23 |
+
|
| 24 |
+
## Model Description
|
| 25 |
+
|
| 26 |
+
This is a LoRA (Low-Rank Adaptation) adapter trained on the [Tongyi-MAI/Z-Image-Turbo](https://huggingface.co/Tongyi-MAI/Z-Image-Turbo) diffusion model. It specializes in generating realistic photographs of Japanese locations, transportation, architecture, and everyday scenes with authentic lighting and composition.
|
| 27 |
+
|
| 28 |
+
## Training Details
|
| 29 |
+
|
| 30 |
+
- **Base Model**: Tongyi-MAI/Z-Image-Turbo
|
| 31 |
+
- **Training Steps**: 2,000
|
| 32 |
+
- **LoRA Rank (r)**: 32
|
| 33 |
+
- **LoRA Alpha**: 32
|
| 34 |
+
- **Learning Rate**: 0.0001
|
| 35 |
+
- **Optimizer**: AdamW 8-bit
|
| 36 |
+
- **Batch Size**: 1 (with gradient accumulation of 4)
|
| 37 |
+
- **Training Resolution**: 512x512
|
| 38 |
+
- **Precision**: bfloat16
|
| 39 |
+
- **Noise Scheduler**: FlowMatch
|
| 40 |
+
- **Trained Using**: [Ostris AI-Toolkit](https://github.com/ostris/ai-toolkit)
|
| 41 |
+
|
| 42 |
+
## Usage
|
| 43 |
+
|
| 44 |
+
### Using with Diffusers
|
| 45 |
+
|
| 46 |
+
```python
|
| 47 |
+
from diffusers import DiffusionPipeline
|
| 48 |
+
import torch
|
| 49 |
+
|
| 50 |
+
# Load base model
|
| 51 |
+
pipe = DiffusionPipeline.from_pretrained(
|
| 52 |
+
"Tongyi-MAI/Z-Image-Turbo",
|
| 53 |
+
torch_dtype=torch.bfloat16
|
| 54 |
+
)
|
| 55 |
+
pipe.to("cuda")
|
| 56 |
+
|
| 57 |
+
# Load LoRA adapter
|
| 58 |
+
pipe.load_lora_weights("your-username/japan_realistic")
|
| 59 |
+
|
| 60 |
+
# Generate image
|
| 61 |
+
prompt = "Photo of a Shinkansen bullet train stopped at a Japanese station platform, overhead roof structure, yellow tactile paving, natural daylight, ultra realistic."
|
| 62 |
+
image = pipe(
|
| 63 |
+
prompt=prompt,
|
| 64 |
+
num_inference_steps=8,
|
| 65 |
+
guidance_scale=1.0,
|
| 66 |
+
width=1024,
|
| 67 |
+
height=1024
|
| 68 |
+
).images
|
| 69 |
+
|
| 70 |
+
image.save("output.png")
|