Instructions to use Hatman/Flux-Prompt-Enhance with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Hatman/Flux-Prompt-Enhance with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Hatman/Flux-Prompt-Enhance")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("Hatman/Flux-Prompt-Enhance") model = AutoModelForSeq2SeqLM.from_pretrained("Hatman/Flux-Prompt-Enhance") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Hatman/Flux-Prompt-Enhance with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Hatman/Flux-Prompt-Enhance" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Hatman/Flux-Prompt-Enhance", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Hatman/Flux-Prompt-Enhance
- SGLang
How to use Hatman/Flux-Prompt-Enhance 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 "Hatman/Flux-Prompt-Enhance" \ --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": "Hatman/Flux-Prompt-Enhance", "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 "Hatman/Flux-Prompt-Enhance" \ --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": "Hatman/Flux-Prompt-Enhance", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Hatman/Flux-Prompt-Enhance with Docker Model Runner:
docker model run hf.co/Hatman/Flux-Prompt-Enhance
HatmanStack commited on
Commit ·
c8d5c42
1
Parent(s): 4b05d70
checkpoint
Browse files
README.md
CHANGED
|
@@ -15,7 +15,7 @@ from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM
|
|
| 15 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 16 |
|
| 17 |
# Model checkpoint
|
| 18 |
-
model_checkpoint = "
|
| 19 |
|
| 20 |
# Tokenizer
|
| 21 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
|
@@ -58,7 +58,7 @@ class PromptEnhancer:
|
|
| 58 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 59 |
|
| 60 |
# Model checkpoint
|
| 61 |
-
self.model_checkpoint = "
|
| 62 |
|
| 63 |
# Tokenizer and Model
|
| 64 |
self.tokenizer = AutoTokenizer.from_pretrained(self.model_checkpoint)
|
|
|
|
| 15 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 16 |
|
| 17 |
# Model checkpoint
|
| 18 |
+
model_checkpoint = "Hatman/Flux-Prompt-Enhance"
|
| 19 |
|
| 20 |
# Tokenizer
|
| 21 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
|
|
|
| 58 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 59 |
|
| 60 |
# Model checkpoint
|
| 61 |
+
self.model_checkpoint = "Hatman/Flux-Prompt-Enhance"
|
| 62 |
|
| 63 |
# Tokenizer and Model
|
| 64 |
self.tokenizer = AutoTokenizer.from_pretrained(self.model_checkpoint)
|