svntax-dev commited on
Commit
d9d0cf3
·
verified ·
0 Parent(s):

initial commit

Browse files
Files changed (2) hide show
  1. .gitattributes +55 -0
  2. README.md +92 -0
.gitattributes ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.lz4 filter=lfs diff=lfs merge=lfs -text
12
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
13
+ *.model filter=lfs diff=lfs merge=lfs -text
14
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
15
+ *.npy filter=lfs diff=lfs merge=lfs -text
16
+ *.npz filter=lfs diff=lfs merge=lfs -text
17
+ *.onnx filter=lfs diff=lfs merge=lfs -text
18
+ *.ot filter=lfs diff=lfs merge=lfs -text
19
+ *.parquet filter=lfs diff=lfs merge=lfs -text
20
+ *.pb filter=lfs diff=lfs merge=lfs -text
21
+ *.pickle filter=lfs diff=lfs merge=lfs -text
22
+ *.pkl filter=lfs diff=lfs merge=lfs -text
23
+ *.pt filter=lfs diff=lfs merge=lfs -text
24
+ *.pth filter=lfs diff=lfs merge=lfs -text
25
+ *.rar filter=lfs diff=lfs merge=lfs -text
26
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
27
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
29
+ *.tar filter=lfs diff=lfs merge=lfs -text
30
+ *.tflite filter=lfs diff=lfs merge=lfs -text
31
+ *.tgz filter=lfs diff=lfs merge=lfs -text
32
+ *.wasm filter=lfs diff=lfs merge=lfs -text
33
+ *.xz filter=lfs diff=lfs merge=lfs -text
34
+ *.zip filter=lfs diff=lfs merge=lfs -text
35
+ *.zst filter=lfs diff=lfs merge=lfs -text
36
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
37
+ # Audio files - uncompressed
38
+ *.pcm filter=lfs diff=lfs merge=lfs -text
39
+ *.sam filter=lfs diff=lfs merge=lfs -text
40
+ *.raw filter=lfs diff=lfs merge=lfs -text
41
+ # Audio files - compressed
42
+ *.aac filter=lfs diff=lfs merge=lfs -text
43
+ *.flac filter=lfs diff=lfs merge=lfs -text
44
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
45
+ *.ogg filter=lfs diff=lfs merge=lfs -text
46
+ *.wav filter=lfs diff=lfs merge=lfs -text
47
+ # Image files - uncompressed
48
+ *.bmp filter=lfs diff=lfs merge=lfs -text
49
+ *.gif filter=lfs diff=lfs merge=lfs -text
50
+ *.png filter=lfs diff=lfs merge=lfs -text
51
+ *.tiff filter=lfs diff=lfs merge=lfs -text
52
+ # Image files - compressed
53
+ *.jpg filter=lfs diff=lfs merge=lfs -text
54
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
55
+ *.webp filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - text-to-image
4
+ - lora
5
+ - diffusers
6
+ - template:diffusion-lora
7
+ widget:
8
+ - output:
9
+ url: images/knight.png
10
+ text: >-
11
+ A pixel art spritesheet of a medieval knight wearing metal armor and a
12
+ helmet with a red plume. The spritesheet is a 4 by 4 grid of four rows of
13
+ frames - first row is 3 walking frames facing down and 1 frame both arms
14
+ raised, second row is 3 walking frames facing left and 1 frame jumping left,
15
+ third row is 3 walking frames facing right and 1 frame jumping right, fourth
16
+ row is 3 walking frames back view facing up and 1 frame lying on floor.
17
+ - output:
18
+ url: images/witch.png
19
+ text: >-
20
+ A pixel art spritesheet of a witch with long red hair and blue eyes, wearing
21
+ a purple hat and robes trimmed with white and light purple colors. The
22
+ spritesheet is a 4 by 4 grid of four rows of frames - first row is 3 walking
23
+ frames facing down and 1 frame both arms raised, second row is 3 walking
24
+ frames facing left and 1 frame jumping left, third row is 3 walking frames
25
+ facing right and 1 frame jumping right, fourth row is 3 walking frames back
26
+ view facing up and 1 frame lying on floor.
27
+ - output:
28
+ url: images/werewolf.png
29
+ text: >-
30
+ A pixel art spritesheet of a werewolf with light gray fur and yellow eyes,
31
+ wearing a red scarf around his neck, and brown leather pants. The
32
+ spritesheet is a 4 by 4 grid of four rows of frames - first row is 3 walking
33
+ frames facing down and 1 frame both arms raised, second row is 3 walking
34
+ frames facing left and 1 frame jumping left, third row is 3 walking frames
35
+ facing right and 1 frame jumping right, fourth row is 3 walking frames back
36
+ view facing up and 1 frame lying on floor.
37
+ base_model: black-forest-labs/FLUX.2-klein-base-4B
38
+ instance_prompt: null
39
+ license: apache-2.0
40
+ ---
41
+ # pixel_spritesheet_4walk_small_lora_v1
42
+
43
+ <Gallery />
44
+
45
+ ## Model description
46
+
47
+ A pixel art spritesheet LoRA for small 32x32 characters, with animation frames for walking up&#x2F;down&#x2F;left&#x2F;right, standing with both arms raised, jumping left&#x2F;right, and lying on the floor.
48
+
49
+ ## How to use
50
+
51
+ You can use the default FLUX.2 Klein base 4B workflows from ComfyUI. Both the text-to-image workflow and the edit base workflow work.
52
+
53
+ Images should be 512x512 because that&#39;s the size of the spritesheets used in training.
54
+
55
+ Both the 2750-steps LoRA and the 3000-steps LoRA are available. The 3000-steps version seems to be more consistent in making humanoid characters, but the 2750-steps version seems a bit more creative in non-humanoid characters if using edit + an image reference.
56
+
57
+ ## Does this LoRA work with FLUX.2 Klein 4B distilled?
58
+
59
+ No. It&#39;s technically compatible, but the distilled model ruins the quality of the pixels and the consistency. Use the base model.
60
+
61
+ ## How to get pixel-perfect images
62
+
63
+ To get pixel-perfect images, downscale by a factor of 4. So 512x512 images should downscale to 128x128. Using k-centroid scaling works well.
64
+
65
+ See the examples below:
66
+
67
+ | Raw output | K-centroid downscaled, then upscaled back to 512x512 |
68
+ | ------------- | ------------- |
69
+ | ![knight](https:&#x2F;&#x2F;cdn-uploads.huggingface.co&#x2F;production&#x2F;uploads&#x2F;68dcbc0eb3e9381d15e2cbbc&#x2F;Sv2ldfiM4S2-5tlzE0buh.png) | ![knight_clean](https:&#x2F;&#x2F;cdn-uploads.huggingface.co&#x2F;production&#x2F;uploads&#x2F;68dcbc0eb3e9381d15e2cbbc&#x2F;cSDU6bnl85wUNL_yV23XO.png) |
70
+ | ![witch](https:&#x2F;&#x2F;cdn-uploads.huggingface.co&#x2F;production&#x2F;uploads&#x2F;68dcbc0eb3e9381d15e2cbbc&#x2F;VJ8wzY3M6r1KM75KxFn8a.png) | ![witch_clean](https:&#x2F;&#x2F;cdn-uploads.huggingface.co&#x2F;production&#x2F;uploads&#x2F;68dcbc0eb3e9381d15e2cbbc&#x2F;Wcx-kKPwRX2sRG2mivTL0.png) |
71
+ | ![werewolf](https:&#x2F;&#x2F;cdn-uploads.huggingface.co&#x2F;production&#x2F;uploads&#x2F;68dcbc0eb3e9381d15e2cbbc&#x2F;st8tgSE_Oq0RNedyW9tQS.png) | ![werewolf_clean](https:&#x2F;&#x2F;cdn-uploads.huggingface.co&#x2F;production&#x2F;uploads&#x2F;68dcbc0eb3e9381d15e2cbbc&#x2F;zAZ8nGev13qmhc3xTn-3_.png) |
72
+
73
+ ## Testing the spritesheets in a game
74
+
75
+ If you want to quickly test your spritesheets in a 2D game, here&#39;s a simple &quot;sandbox&quot; game&#x2F;tool where you can upload the raw spritesheet outputs and spawn in your characters to move around:
76
+
77
+ Link: https:&#x2F;&#x2F;svntax.github.io&#x2F;pixel-art-spritesheet-sandbox&#x2F;
78
+ Source: https:&#x2F;&#x2F;github.com&#x2F;svntax&#x2F;pixel-art-spritesheet-sandbox
79
+
80
+ ## Notes
81
+
82
+ This is a first attempt at making a pixel art spritesheet LoRA using small sprites. There are sometimes bad images generated with issues like hair or headwear being cut off, and non-human characters with bad anatomy. The bottom row of sprites with the back view also has problems with consistency sometimes (for example, the werewolf is missing the red scarf).
83
+
84
+ ## Credits
85
+
86
+ - The dataset used to train this LoRA consists of spritesheets edited and based on a template spritesheet by [George Bailey](https:&#x2F;&#x2F;opengameart.org&#x2F;content&#x2F;16x16-game-assets), licensed under [CC BY 4.0](https:&#x2F;&#x2F;creativecommons.org&#x2F;licenses&#x2F;by&#x2F;4.0&#x2F;)
87
+
88
+
89
+ ## Download model
90
+
91
+
92
+ [Download](/svntax-dev/pixel_spritesheet_4walk_small_lora_v1/tree/main) them in the Files & versions tab.