Image-Text-to-Text
Transformers
Safetensors
English
Chinese
groundinganything
text-generation
visual-grounding
object-detection
referring-expression-comprehension
pointing
ocr
document-layout
custom-code
diffusion-language-model
conversational
custom_code
Instructions to use GroundingPI/GroundAnything with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GroundingPI/GroundAnything with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="GroundingPI/GroundAnything", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("GroundingPI/GroundAnything", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use GroundingPI/GroundAnything with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GroundingPI/GroundAnything" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GroundingPI/GroundAnything", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/GroundingPI/GroundAnything
- SGLang
How to use GroundingPI/GroundAnything 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 "GroundingPI/GroundAnything" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GroundingPI/GroundAnything", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "GroundingPI/GroundAnything" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GroundingPI/GroundAnything", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use GroundingPI/GroundAnything with Docker Model Runner:
docker model run hf.co/GroundingPI/GroundAnything
Download config.json from GroundingPI/GroundAnything: direct link, hf CLI and curl.
- Browser
- Download file 3.94 kB
-
https://huggingface.co/GroundingPI/GroundAnything/resolve/main/config.json
- Command line
-
hf download hf://GroundingPI/GroundAnything/config.json
-
curl -L -o config.json https://huggingface.co/GroundingPI/GroundAnything/resolve/main/config.json
3.94 kB
| { | |
| "architectures": [ | |
| "GroundAnythingForConditionalGeneration" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_groundinganything.GroundAnythingConfig", | |
| "AutoModel": "modeling_groundinganything.GroundAnythingModel", | |
| "AutoModelForCausalLM": "modeling_groundinganything.GroundAnythingForConditionalGeneration", | |
| "AutoModelForImageTextToText": "modeling_groundinganything.GroundAnythingForConditionalGeneration", | |
| "AutoProcessor": "processing_groundinganything.GroundAnythingProcessor" | |
| }, | |
| "bos_token_id": null, | |
| "dtype": "bfloat16", | |
| "eos_token_id": 151645, | |
| "hidden_size": 2560, | |
| "image_token_id": 151655, | |
| "model_type": "groundinganything", | |
| "pad_token_id": 151643, | |
| "text_config": { | |
| "_name_or_path": "Qwen3-4B-Instruct-2507", | |
| "architectures": [ | |
| "Qwen3ForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "bos_token_id": 151643, | |
| "dtype": "bfloat16", | |
| "eos_token_id": 151645, | |
| "head_dim": 128, | |
| "hidden_act": "silu", | |
| "hidden_size": 2560, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 9728, | |
| "layer_types": [ | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention" | |
| ], | |
| "max_position_embeddings": 262144, | |
| "max_window_layers": 36, | |
| "model_type": "qwen3", | |
| "num_attention_heads": 32, | |
| "num_hidden_layers": 36, | |
| "num_key_value_heads": 8, | |
| "pad_token_id": 151643, | |
| "rms_norm_eps": 1e-06, | |
| "rope_parameters": { | |
| "rope_theta": 5000000, | |
| "rope_type": "default" | |
| }, | |
| "sliding_window": null, | |
| "tie_word_embeddings": false, | |
| "use_cache": false, | |
| "use_sliding_window": false, | |
| "vocab_size": 152670 | |
| }, | |
| "tie_word_embeddings": false, | |
| "transformers_version": "5.7.0", | |
| "use_cache": false, | |
| "video_token_id": 151656, | |
| "vision_config": { | |
| "activation_func": "gelu_pytorch_tanh", | |
| "attention_dropout": 0.0, | |
| "attn_bias": false, | |
| "dtype": "bfloat16", | |
| "frame_windows_size": 4, | |
| "hidden_act": "gelu", | |
| "hidden_size": 1024, | |
| "image_size": 448, | |
| "init_pos_emb_height": 64, | |
| "init_pos_emb_time": 4, | |
| "init_pos_emb_width": 64, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 4096, | |
| "layer_norm_eps": 1e-06, | |
| "layer_norm_type": "layer_norm", | |
| "linear_bias": false, | |
| "max_position_embeddings": 8192, | |
| "merge_kernel_size": [ | |
| 2, | |
| 2 | |
| ], | |
| "merge_type": "sd2_tpool", | |
| "mlp_type": "mlp2", | |
| "model_type": "groundinganything_vision", | |
| "norm_type": "rmsnorm", | |
| "num_attention_heads": 12, | |
| "num_channels": 3, | |
| "num_hidden_layers": 27, | |
| "out_hidden_size": 2560, | |
| "patch_embed_proj_bias": false, | |
| "patch_position_encoding_type": "absolute", | |
| "patch_size": 14, | |
| "pos_emb_interpolation_mode": "bilinear", | |
| "pos_emb_type": "divided_fixed", | |
| "projector_hidden_act": "gelu", | |
| "projector_hidden_size": 4096, | |
| "projector_ln_eps": 1e-05, | |
| "qkv_hidden_size": 1536, | |
| "rope_theta": 10000.0, | |
| "spatial_merge_size": 2, | |
| "tokens_per_second": 1, | |
| "use_head": false, | |
| "use_patch_position_encoding": false | |
| }, | |
| "vision_end_token_id": 151653, | |
| "vision_start_token_id": 151652 | |
| } | |