Text-to-Image
Diffusers
flux2
flux2-diffusers
image-to-image
lora
standard
macos
liquid-glass
icon-generation
apple-design
Instructions to use Andy-ML-And-AI/LIQGLASS with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Andy-ML-And-AI/LIQGLASS with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-base-4B", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("Andy-ML-And-AI/LIQGLASS") prompt = "LIQGLASS, macOS Liquid Glass style icon, translucent frosted glass squircle shape, Safari browser app, compass symbol, blue tinted glass, specular highlight, inner glow, light refraction at edges, depth layering, soft shadow, Apple macOS design language, high detail" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Model card auto-generated by SimpleTuner
Browse files
README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
base_model: "black-forest-labs/FLUX.2-klein-base-4B"
|
| 4 |
+
tags:
|
| 5 |
+
- flux2
|
| 6 |
+
- flux2-diffusers
|
| 7 |
+
- text-to-image
|
| 8 |
+
- image-to-image
|
| 9 |
+
- diffusers
|
| 10 |
+
- simpletuner
|
| 11 |
+
- not-for-all-audiences
|
| 12 |
+
- lora
|
| 13 |
+
|
| 14 |
+
- template:sd-lora
|
| 15 |
+
- standard
|
| 16 |
+
pipeline_tag: text-to-image
|
| 17 |
+
inference: true
|
| 18 |
+
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
# Andy-ML-And-AI/LIQGLASS-klein-lora
|
| 22 |
+
|
| 23 |
+
This is a PEFT LoRA derived from [black-forest-labs/FLUX.2-klein-base-4B](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-4B).
|
| 24 |
+
|
| 25 |
+
The main validation prompt used during training was:
|
| 26 |
+
```
|
| 27 |
+
LIQGLASS, macOS Liquid Glass style icon, translucent frosted glass squircle shape, Safari browser app, compass symbol, blue tinted glass, specular highlight, inner glow, light refraction at edges, depth layering, soft shadow, Apple macOS design language, high detail
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
## Validation settings
|
| 32 |
+
- CFG: `None`
|
| 33 |
+
- CFG Rescale: `0.0`
|
| 34 |
+
- Steps: `20`
|
| 35 |
+
- Sampler: `FlowMatchEulerDiscreteScheduler`
|
| 36 |
+
- Seed: `42`
|
| 37 |
+
- Resolution: `512x512`
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
Note: The validation settings are not necessarily the same as the [training settings](#training-settings).
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
<Gallery />
|
| 46 |
+
|
| 47 |
+
The text encoder **was not** trained.
|
| 48 |
+
You may reuse the base model text encoder for inference.
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
## Training settings
|
| 52 |
+
|
| 53 |
+
- Training epochs: 0
|
| 54 |
+
- Training steps: 200
|
| 55 |
+
- Learning rate: 0.0001
|
| 56 |
+
- Learning rate schedule: constant
|
| 57 |
+
- Warmup steps: 0
|
| 58 |
+
- Max grad value: 2.0
|
| 59 |
+
- Effective batch size: 1
|
| 60 |
+
- Micro-batch size: 1
|
| 61 |
+
- Gradient accumulation steps: 1
|
| 62 |
+
- Number of GPUs: 1
|
| 63 |
+
- Gradient checkpointing: True
|
| 64 |
+
- Prediction type: flow_matching[]
|
| 65 |
+
- Optimizer: adamw_bf16
|
| 66 |
+
- Trainable parameter precision: Pure BF16
|
| 67 |
+
- Base model precision: `int8-quanto`
|
| 68 |
+
- Caption dropout probability: 0.1%
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
- LoRA Rank: 8
|
| 73 |
+
- LoRA Alpha: 8.0
|
| 74 |
+
- LoRA Dropout: 0.1
|
| 75 |
+
- LoRA initialisation style: default
|
| 76 |
+
- LoRA mode: Standard
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
## Datasets
|
| 80 |
+
|
| 81 |
+
### liqglass-dataset
|
| 82 |
+
- Repeats: 0
|
| 83 |
+
- Total number of images: 542
|
| 84 |
+
- Total number of aspect buckets: 1
|
| 85 |
+
- Resolution: 0.262144 megapixels
|
| 86 |
+
- Cropped: True
|
| 87 |
+
- Crop style: center
|
| 88 |
+
- Crop aspect: square
|
| 89 |
+
- Used for regularisation data: No
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
## Inference
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
```python
|
| 96 |
+
import torch
|
| 97 |
+
from diffusers import DiffusionPipeline
|
| 98 |
+
|
| 99 |
+
model_id = 'black-forest-labs/FLUX.2-klein-base-4B'
|
| 100 |
+
adapter_id = 'Andy-ML-And-AI/Andy-ML-And-AI/LIQGLASS-klein-lora'
|
| 101 |
+
pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
|
| 102 |
+
pipeline.load_lora_weights(adapter_id)
|
| 103 |
+
|
| 104 |
+
prompt = "LIQGLASS, macOS Liquid Glass style icon, translucent frosted glass squircle shape, Safari browser app, compass symbol, blue tinted glass, specular highlight, inner glow, light refraction at edges, depth layering, soft shadow, Apple macOS design language, high detail"
|
| 105 |
+
negative_prompt = 'ugly, flat, matte, no glass effect, blurry, low quality, old style, skeuomorphic, glossy blob, vista style'
|
| 106 |
+
|
| 107 |
+
## Optional: quantise the model to save on vram.
|
| 108 |
+
## Note: The model was quantised during training, and so it is recommended to do the same during inference time.
|
| 109 |
+
from optimum.quanto import quantize, freeze, qint8
|
| 110 |
+
quantize(pipeline.transformer, weights=qint8)
|
| 111 |
+
freeze(pipeline.transformer)
|
| 112 |
+
|
| 113 |
+
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
|
| 114 |
+
model_output = pipeline(
|
| 115 |
+
prompt=prompt,
|
| 116 |
+
negative_prompt=negative_prompt,
|
| 117 |
+
num_inference_steps=20,
|
| 118 |
+
generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
|
| 119 |
+
width=512,
|
| 120 |
+
height=512,
|
| 121 |
+
guidance_scale=None,
|
| 122 |
+
).images[0]
|
| 123 |
+
|
| 124 |
+
model_output.save("output.png", format="PNG")
|
| 125 |
+
|
| 126 |
+
```
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
|