Instructions to use svntax-dev/pixel_assets_general_ernie_v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use svntax-dev/pixel_assets_general_ernie_v1 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("baidu/ERNIE-Image", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("svntax-dev/pixel_assets_general_ernie_v1") prompt = "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." image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
| 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 | |
| <Gallery /> | |
| ## 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| | |
| | ------------- | ------------- | | |
| |  |  | | |
| |  |  | | |
| |  |  | | |
| |  |  | | |
| |  |  | | |
| |  |  | |
| |  |  | | |
| |  |  | | |
| |  |  | | |
| ## 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. | |