Views
No views yet
| Original ERNIE-Image | Ovedrive NF4 quantized |
|---|---|
![]() | ![]() |
| Full precision baseline | Mixed precision NF4 |
pip install git+https://github.com/huggingface/diffusers1import torch
2from diffusers import ErnieImagePipeline
3
4pipe = ErnieImagePipeline.from_pretrained(
5 "ovedrive/ERNIE-Image-nf4",
6 torch_dtype=torch.bfloat16,
7).to("cuda")
8
9image = pipe(
10 prompt="This is a photograph depicting an urban street scene. Shot at eye level, it shows a covered pedestrian or commercial street. Slightly below the center of the frame, a cyclist rides away from the camera toward the background, appearing as a dark silhouette against backlighting with indistinct details. The ground is paved with regular square tiles, bisected by a prominent tactile paving strip running through the scene, whose raised textures are clearly visible under the light. Light streams in diagonally from the right side of the frame, creating a strong backlight effect with a distinct Tyndall effect—visible light beams illuminating dust or vapor in the air and casting long shadows across the street. Several pedestrians appear on the left side and in the distance, some with their backs to the camera and others walking sideways, all rendered as silhouettes or semi-silhouettes. The overall color palette is warm, dominated by golden yellows and dark browns, evoking the atmosphere of dusk or early morning.",
11 height=1264,
12 width=848,
13 num_inference_steps=50,
14 guidance_scale=4.0,
15 use_pe=True # use prompt enhancer
16).images[0]
17
18image.save("output.png")git clone https://github.com/sgl-project/sglang.gitsglang serve --model-path baidu/ERNIE-Image1curl -X POST http://localhost:30000/v1/images/generations \
2 -H "Content-Type: application/json" \
3 -d '{
4 "prompt": "This is a photograph depicting an urban street scene. Shot at eye level, it shows a covered pedestrian or commercial street. Slightly below the center of the frame, a cyclist rides away from the camera toward the background, appearing as a dark silhouette against backlighting with indistinct details. The ground is paved with regular square tiles, bisected by a prominent tactile paving strip running through the scene, whose raised textures are clearly visible under the light. Light streams in diagonally from the right side of the frame, creating a strong backlight effect with a distinct Tyndall effect—visible light beams illuminating dust or vapor in the air and casting long shadows across the street. Several pedestrians appear on the left side and in the distance, some with their backs to the camera and others walking sideways, all rendered as silhouettes or semi-silhouettes. The overall color palette is warm, dominated by golden yellows and dark browns, evoking the atmosphere of dusk or early morning.",
5 "height": 1264,
6 "width": 848,
7 "num_inference_steps": 50,
8 "guidance_scale": 4.0,
9 "use_pe": true
10
11 }' \
12 --output output.png