Instructions to use HiDream-ai/Prompt-Refine with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HiDream-ai/Prompt-Refine with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="HiDream-ai/Prompt-Refine")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("HiDream-ai/Prompt-Refine", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use HiDream-ai/Prompt-Refine with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HiDream-ai/Prompt-Refine" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HiDream-ai/Prompt-Refine", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/HiDream-ai/Prompt-Refine
- SGLang
How to use HiDream-ai/Prompt-Refine with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "HiDream-ai/Prompt-Refine" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HiDream-ai/Prompt-Refine", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "HiDream-ai/Prompt-Refine" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HiDream-ai/Prompt-Refine", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use HiDream-ai/Prompt-Refine with Docker Model Runner:
docker model run hf.co/HiDream-ai/Prompt-Refine
Prompt-Refine Quantized to GGUF Format
#2
by tuolaku - opened
To facilitate local loading and inference for users, I have quantized Prompt-Refine. Currently, there are two options available: Q4_K_M and Q6_K. The former can run on a GPU with 24GB VRAM, while the latter requires a GPU with 32GB VRAM. The above models have been verified in LM Studio.
The download link is: https://huggingface.co/tuolaku/Prompt-Refine-GGUF/tree/main