Views
No views yet
A figurine of a character with green hair, wearing a white shirt, a black vest, and a gray cap, sitting with one hand on their knee and the other hand making a peace sign. The character is wearing a blue pendant and has a gold bracelet. In the background, there are green plants and a tree branch.3.00.020None421024x10241{
2 "algo": "lokr",
3 "multiplier": 1.0,
4 "linear_dim": 1000000,
5 "linear_alpha": 1,
6 "factor": 2,
7 "full_matrix": true,
8 "apply_preset": {
9 "name_algo_map": {
10 "transformer_blocks.[0-7]*": {
11 "algo": "lokr",
12 "factor": 4,
13 "linear_dim": 1000000,
14 "linear_alpha": 1,
15 "full_matrix": true
16 },
17 "transformer_blocks.[8-15]*": {
18 "algo": "lokr",
19 "factor": 5,
20 "linear_dim": 1000000,
21 "linear_alpha": 1,
22 "full_matrix": true
23 },
24 "transformer_blocks.[16-18]*": {
25 "algo": "lokr",
26 "factor": 10,
27 "linear_dim": 1000000,
28 "linear_alpha": 1,
29 "full_matrix": true
30 },
31 "single_transformer_blocks.[0-15]*": {
32 "algo": "lokr",
33 "factor": 8,
34 "linear_dim": 1000000,
35 "linear_alpha": 1,
36 "full_matrix": true
37 },
38 "single_transformer_blocks.[16-23]*": {
39 "algo": "lokr",
40 "factor": 5,
41 "linear_dim": 1000000,
42 "linear_alpha": 1,
43 "full_matrix": true
44 },
45 "single_transformer_blocks.[24-37]*": {
46 "algo": "lokr",
47 "factor": 4,
48 "linear_dim": 1000000,
49 "linear_alpha": 1,
50 "use_scalar": true,
51 "full_matrix": true
52 }
53 },
54 "use_fnmatch": true
55 }
56}1import torch
2from diffusers import DiffusionPipeline
3from lycoris import create_lycoris_from_weights
4
5model_id = 'black-forest-labs/FLUX.1-schnell'
6adapter_id = 'pytorch_lora_weights.safetensors' # you will have to download this manually
7lora_scale = 1.0
8wrapper, _ = create_lycoris_from_weights(lora_scale, adapter_id, pipeline.transformer)
9wrapper.merge_to()
10
11prompt = "A figurine of a character with green hair, wearing a white shirt, a black vest, and a gray cap, sitting with one hand on their knee and the other hand making a peace sign. The character is wearing a blue pendant and has a gold bracelet. In the background, there are green plants and a tree branch."
12
13pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu')
14image = pipeline(
15 prompt=prompt,
16 num_inference_steps=20,
17 generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(1641421826),
18 width=1024,
19 height=1024,
20 guidance_scale=3.0,
21).images[0]
22image.save("output.png", format="PNG")