Text-to-Image
Diffusers
OpenVINO
StableDiffusionXLPipeline
int4
optimum
optimum-intel
nncf
lcm
anime
sdxl
cpu
8-step
Instructions to use HelloSun/nova_xl_lcm-OpenVINO-INT4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use HelloSun/nova_xl_lcm-OpenVINO-INT4 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("HelloSun/nova_xl_lcm-OpenVINO-INT4", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Download inference_int4.py from HelloSun/nova_xl_lcm-OpenVINO-INT4: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/HelloSun/nova_xl_lcm-OpenVINO-INT4/resolve/main/inference_int4.py
- Command line
-
hf download hf://HelloSun/nova_xl_lcm-OpenVINO-INT4/inference_int4.py
-
curl -L -o inference_int4.py https://huggingface.co/HelloSun/nova_xl_lcm-OpenVINO-INT4/resolve/main/inference_int4.py
1.02 kB
| """Nova XL LCM OpenVINO INT4 inference example (optimum-intel). | |
| Requires: diffusers==0.37.1, transformers==4.57.6, tokenizers==0.22.0, | |
| huggingface-hub==0.35.1, optimum-intel==2.2.0, optimum==2.3.0, | |
| openvino==2026.4.0, nncf==3.4.0, torch, pillow, psutil | |
| Source model: sca255/nova_xl_lcm (SDXL LCM anime). | |
| Recipe: num_inference_steps=8, guidance_scale=1.5, 1024x1024. | |
| """ | |
| import torch | |
| from optimum.intel import OVDiffusionPipeline | |
| MODEL_ID = "HelloSun/nova_xl_lcm-OpenVINO-INT4" # or local ./nova_xl_lcm-ov-int4 | |
| def main(): | |
| pipe = OVDiffusionPipeline.from_pretrained(MODEL_ID, compile=True) | |
| prompt = "1girl, anime style, masterpiece, best quality, detailed face, beautiful eyes" | |
| image = pipe( | |
| prompt=prompt, | |
| height=1024, width=1024, | |
| num_inference_steps=8, | |
| guidance_scale=1.5, | |
| generator=torch.Generator().manual_seed(42), | |
| ).images[0] | |
| image.save("nova_xl_lcm_ov_int4.png") | |
| print("saved nova_xl_lcm_ov_int4.png") | |
| if __name__ == "__main__": | |
| main() | |