| | --- |
| | tags: |
| | - text-to-image |
| | - lora |
| | - diffusers |
| | - template:sd-lora |
| | - ai-toolkit |
| | base_model: Qwen/Qwen-Image |
| | license: creativeml-openrail-m |
| | inference: |
| | parameters: |
| | width: 512 |
| | height: 512 |
| | --- |
| | |
| | # pixel_portrait_lora_v1-lora |
| | |
| | Model trained with [AI Toolkit by Ostris](https://github.com/ostris/ai-toolkit) |
| | |
| | |
| | |
| | ## Trigger words |
| | |
| | No trigger words defined, but it's recommended to start with "*A portrait of \[subject\] with \[appearance/traits\]*". |
| | |
| | ## Sample outputs |
| | |
| | Images from left-to-right were generated at 512x512 with: |
| | |
| | No LoRA, 500 steps, 1000 steps, 1500 steps, 2000 steps (final checkpoint) |
| | |
| | ### Medieval Knight |
| | |
| | **Prompt**: *A portrait of a medieval knight with iron armor, wearing a full iron helmet with a red plume on the back side of the helm. The knight is facing front right at a 45-degree angle with a neutral pose. The iron armor is clean and reflective, showing a clean polish.* |
| | |
| |  |
| | |
| | ### Witch |
| | |
| | **Prompt**: *A portrait of a witch with long red hair and blue eyes, wearing a dark purple witch hat and robes. The witch is facing left with a neutral expression. The robes are trimmed with white and light purple colors.* |
| | |
| |  |
| | |
| | ### Werewolf |
| | |
| | **Prompt**: *A portrait of a werewolf with light gray fur and yellow eyes, wearing a red scarf and a sword on his back. The werewolf is facing forward with a confident expression.* |
| | |
| |  |
| | |
| | |
| | ## How to get pixel-perfect images |
| | |
| | To get pixel-perfect images, downscale by a factor of 8. So 512x512 images should downscale to 64x64, 1024x1024 to 128x128, and so on. |
| | |
| | You can generate at higher resolutions like 1024x1024, but you may get worse pixel quality because the LoRA was trained on 512x512 images only. |
| | |
| | |
| | ## Download model and use it with ComfyUI, AUTOMATIC1111, SD.Next, Invoke AI, etc. |
| | |
| | Weights for this model are available in Safetensors format. |
| | |
| | [Download](svntax-dev/pixel_portrait_lora_v1-lora/tree/main) them in the Files & versions tab. |
| | |
| | ## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers) |
| | |
| | ```py |
| | from diffusers import AutoPipelineForText2Image |
| | import torch |
| | |
| | pipeline = AutoPipelineForText2Image.from_pretrained('Qwen/Qwen-Image', torch_dtype=torch.bfloat16).to('cuda') |
| | pipeline.load_lora_weights('svntax-dev/pixel_portrait_lora_v1-lora', weight_name='pixel_portrait_lora_v1_000001500.safetensors') |
| | image = pipeline('a beautiful landscape').images[0] |
| | image.save("my_image.png") |
| | ``` |
| | |
| | For more details, including weighting, merging and fusing LoRAs, check the [documentation on loading LoRAs in diffusers](https://huggingface.co/docs/diffusers/main/en/using-diffusers/loading_adapters) |
| | |
| | |