maver1chh commited on
Commit
7e1cd2d
·
verified ·
1 Parent(s): 5cbe665

Model card auto-generated by SimpleTuner

Browse files
Files changed (1) hide show
  1. README.md +140 -0
README.md ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ base_model: "black-forest-labs/FLUX.1-dev"
4
+ tags:
5
+ - flux
6
+ - flux-diffusers
7
+ - text-to-image
8
+ - diffusers
9
+ - simpletuner
10
+ - not-for-all-audiences
11
+ - lora
12
+ - template:sd-lora
13
+ - standard
14
+ inference: true
15
+ widget:
16
+ - text: 'unconditional (blank prompt)'
17
+ parameters:
18
+ negative_prompt: 'blurry, cropped, ugly'
19
+ output:
20
+ url: ./assets/image_0_0.png
21
+ - text: 'A peaceful Japanese-inspired scene unfolds, showcasing a cozy retreat nestled in the heart of nature. Towering mountains rise in the distance, framing a serene environment filled with vibrant plants and lush greenery. A calm pond reflects the bright sunlight, its surface adorned with delicate ripples and blooming lotus flowers—where Frog basks on a lily pad, quietly observing the tranquil surroundings. Nearby, a rose garden adds a touch of romance, its soft petals contrasting beautifully with the earthy tones of the environment. Inside the rustic cottage, CRT sitting in calm wearing headphones, adding a hint of nostalgic charm that complements the timeless beauty outside. This setting exudes tranquility, inviting you to pause, breathe, and connect with the harmony of nature—a perfect haven where the natural splendor of Japan landscapes meets cozy serenity.'
22
+ parameters:
23
+ negative_prompt: 'blurry, cropped, ugly'
24
+ output:
25
+ url: ./assets/image_1_0.png
26
+ ---
27
+
28
+ # maver1chh/cha_2401
29
+
30
+ This is a standard PEFT LoRA derived from [black-forest-labs/FLUX.1-dev](https://huggingface.co/black-forest-labs/FLUX.1-dev).
31
+
32
+
33
+ The main validation prompt used during training was:
34
+ ```
35
+ A peaceful Japanese-inspired scene unfolds, showcasing a cozy retreat nestled in the heart of nature. Towering mountains rise in the distance, framing a serene environment filled with vibrant plants and lush greenery. A calm pond reflects the bright sunlight, its surface adorned with delicate ripples and blooming lotus flowers—where Frog basks on a lily pad, quietly observing the tranquil surroundings. Nearby, a rose garden adds a touch of romance, its soft petals contrasting beautifully with the earthy tones of the environment. Inside the rustic cottage, CRT sitting in calm wearing headphones, adding a hint of nostalgic charm that complements the timeless beauty outside. This setting exudes tranquility, inviting you to pause, breathe, and connect with the harmony of nature—a perfect haven where the natural splendor of Japan landscapes meets cozy serenity.
36
+ ```
37
+
38
+
39
+ ## Validation settings
40
+ - CFG: `3.0`
41
+ - CFG Rescale: `0.0`
42
+ - Steps: `20`
43
+ - Sampler: `FlowMatchEulerDiscreteScheduler`
44
+ - Seed: `42`
45
+ - Resolution: `1344x768`
46
+ - Skip-layer guidance:
47
+
48
+ Note: The validation settings are not necessarily the same as the [training settings](#training-settings).
49
+
50
+ You can find some example images in the following gallery:
51
+
52
+
53
+ <Gallery />
54
+
55
+ The text encoder **was not** trained.
56
+ You may reuse the base model text encoder for inference.
57
+
58
+
59
+ ## Training settings
60
+
61
+ - Training epochs: 1
62
+ - Training steps: 1000
63
+ - Learning rate: 0.0005
64
+ - Learning rate schedule: polynomial
65
+ - Warmup steps: 200
66
+ - Max grad norm: 1.0
67
+ - Effective batch size: 1
68
+ - Micro-batch size: 1
69
+ - Gradient accumulation steps: 1
70
+ - Number of GPUs: 1
71
+ - Gradient checkpointing: True
72
+ - Prediction type: flow-matching (extra parameters=['shift=3', 'flux_guidance_mode=constant', 'flux_guidance_value=1.0', 'flow_matching_loss=compatible', 'flux_lora_target=all'])
73
+ - Optimizer: adamw_bf16
74
+ - Trainable parameter precision: Pure BF16
75
+ - Caption dropout probability: 10.0%
76
+
77
+
78
+ - LoRA Rank: 16
79
+ - LoRA Alpha: 16.0
80
+ - LoRA Dropout: 0.1
81
+ - LoRA initialisation style: default
82
+
83
+
84
+ ## Datasets
85
+
86
+ ### cha_2401_512
87
+ - Repeats: 5
88
+ - Total number of images: 43
89
+ - Total number of aspect buckets: 1
90
+ - Resolution: 0.262144 megapixels
91
+ - Cropped: False
92
+ - Crop style: None
93
+ - Crop aspect: None
94
+ - Used for regularisation data: No
95
+ ### cha_2401_768
96
+ - Repeats: 5
97
+ - Total number of images: 43
98
+ - Total number of aspect buckets: 1
99
+ - Resolution: 0.589824 megapixels
100
+ - Cropped: False
101
+ - Crop style: None
102
+ - Crop aspect: None
103
+ - Used for regularisation data: No
104
+
105
+
106
+ ## Inference
107
+
108
+
109
+ ```python
110
+ import torch
111
+ from diffusers import DiffusionPipeline
112
+
113
+ model_id = 'black-forest-labs/FLUX.1-dev'
114
+ adapter_id = 'maver1chh/maver1chh/cha_2401'
115
+ pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
116
+ pipeline.load_lora_weights(adapter_id)
117
+
118
+ prompt = "A peaceful Japanese-inspired scene unfolds, showcasing a cozy retreat nestled in the heart of nature. Towering mountains rise in the distance, framing a serene environment filled with vibrant plants and lush greenery. A calm pond reflects the bright sunlight, its surface adorned with delicate ripples and blooming lotus flowers—where Frog basks on a lily pad, quietly observing the tranquil surroundings. Nearby, a rose garden adds a touch of romance, its soft petals contrasting beautifully with the earthy tones of the environment. Inside the rustic cottage, CRT sitting in calm wearing headphones, adding a hint of nostalgic charm that complements the timeless beauty outside. This setting exudes tranquility, inviting you to pause, breathe, and connect with the harmony of nature—a perfect haven where the natural splendor of Japan landscapes meets cozy serenity."
119
+
120
+
121
+ ## Optional: quantise the model to save on vram.
122
+ ## Note: The model was quantised during training, and so it is recommended to do the same during inference time.
123
+ from optimum.quanto import quantize, freeze, qint8
124
+ quantize(pipeline.transformer, weights=qint8)
125
+ freeze(pipeline.transformer)
126
+
127
+ pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu') # the pipeline is already in its target precision level
128
+ image = pipeline(
129
+ prompt=prompt,
130
+ num_inference_steps=20,
131
+ generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
132
+ width=1344,
133
+ height=768,
134
+ guidance_scale=3.0,
135
+ ).images[0]
136
+ image.save("output.png", format="PNG")
137
+ ```
138
+
139
+
140
+