--- tags: - text-to-image - lora - diffusers - template:diffusion-lora widget: - output: url: images/knight.png text: >- A pixel art sprite of a medieval knight wearing metal armor and a helmet with a red plume, a sword in one hand and a shield in the other hand. The background is white. - output: url: images/witch.png text: >- A pixel art image of a witch with long red hair and blue eyes, wearing a purple hat and robes trimmed with white and light purple colors. White background - output: url: images/butler.png text: >- A pixel art image of a man with light brown hair in a long ponytail. He is wearing a butler outfit and leaning forward towards the viewer holding a bowl of soup. The background is a fancy restaurant with dining tables in the back, a chandelier, and a painting of a noblewoman on the left walls. - output: url: images/island_base.png text: >- A pixel art aerial shot of an island in the middle of the ocean. On the right side of the island is a giant metal orb building with a satellite on top of it. - output: url: images/sand_dunes_tower.png text: >- A pixel art scene of wide, vast sand dunes with a tall cylindrical tower in the far background surrounded by a sandstorm. In the foreground is a medieval carriage being pulled by a triceratops moving towards the tower. - output: url: images/stairs_darkness_eyes.png text: >- A pixel art image of a top-down view of stairs leading down into darkness. In the background the darkness has several faint red eyes. - output: url: images/ddagger_grid.png text: >- A pixel art sprite of a short red dagger with a green poisoned tip on the top right and a gray and brown hilt. There are 16 copies of the sprite in a 4 by 4 grid. The background is white. - output: url: images/dshield.png text: >- A pixel art sprite of a rectangular orange shield with the head of a gray dragon with its mouth open facing straight. The background is white. - output: url: images/skeleton_sprite.png text: >- A pixel art sprite of a skeleton warrior wearing a helmet with two horns, holding an axe with both hands raised, facing right, white background base_model: baidu/ERNIE-Image instance_prompt: null license: apache-2.0 --- # pixel_assets_general_ernie_v1 ## Model description A pixel art LoRA for general-purpose game assets such as character sprites, creatures, items/equipment, backgrounds, scenery, and icons. ## How to use You can use the default ERNIE-Image-Turbo workflow from ComfyUI, and no prompt enhancer needed. The sample images also have workflows. ## How to get pixel-perfect images Downscale by a factor of 4. So 512x512 images should downscale to 128x128, 1024x1024 to 256x256, and so on. Using k-centroid with something like [PixelOE](https://github.com/KohakuBlueleaf/PixelOE) works well. See examples below: | Raw output | K-centroid downscaled, then upscaled back 4x| | ------------- | ------------- | | ![knight](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/YzaDV03t2nse5CW_1zjmh.png) | ![knight_kcentroid](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/3Jz0HXEky8f0-qbPWOSaX.png) | | ![witch](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/aVTiekoH43PH8ea-GBcuQ.png) | ![witch_kcentroid](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/lS8ult9Wy48BmKO0UmVFB.png) | | ![butler](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/lH4MZ7Ej3idWetAqKpCJ7.png) | ![butler_kcentroid](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/F7vttfNn992sgTENoRCow.png) | | ![island_base](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/pXhyysqvG6eLLNM5BGVSg.png) | ![island_base_kcentroid](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/lN2e8MkFf64Xv7cChLSp3.png) | | ![sand_dunes_tower](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/y52scgX3_d9dVmcRTFCOr.png) | ![sand_dunes_tower_kcentroid](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/Box0VumA-MySo_GgI2rnM.png) | | ![stairs_darkness_eyes](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/ISeSI_bUcjP76iF0uELRj.png) | ![stairs_darkness_eyes_kcentroid](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/B0XEbbezIYWZRh9m-rDCH.png) | ![ddagger_grid](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/U4_aHp1fj2w3QsdgGXdaH.png) | ![ddagger_grid_kcentroid](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/JGpWpER4tSkzhfnR2XkON.png) | | ![dshield](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/h77Zm-gbhfEwwrd3Nj7J7.png) | ![dshield_kcentroid](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/wRWXTBX1jvpX2eR52o1c-.png) | | ![skeleton_sprite](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/zeyVs6sByyMdYJMedVWtq.png) | ![skeleton_sprite_kcentroid](https://cdn-uploads.huggingface.co/production/uploads/68dcbc0eb3e9381d15e2cbbc/h-MaleeTuU0klLP95Wo2j.png) | ## Does this LoRA work with ERNIE-Image base? Yes, but I don't recommend it. **The LoRA is meant to be used with the turbo model.** For some reason, outputs with the base model are very bad. The colors are way too bright or saturated, and there are more issues with anatomy. Maybe there's a problem with my settings. ## Notes & Issues There are still some issues with certain prompts with the ERNIE turbo model. - The model tends to make characters face forward or in a 3/4 angle even if your prompt has a different view. This might just be a limit of the turbo model, though. - If prompting for sprites, make sure to include "white background" somewhere, otherwise you'll sometimes get a detailed background. - Since I trained this on a 4x upscaled pixel art dataset, if you want smaller sprites, just prompt for copies of a sprite in a 2x2 or 4x4 grid (see the sample images). - The dataset this LoRA was trained on contains 512x512, 768x768, and 1024x1024 images, but you can change the resolution and still get decent images. ## Download model [Download](/svntax-dev/pixel_assets_general_ernie_v1/tree/main) them in the Files & versions tab.