Instructions to use glowskeleton/goblin-models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sam2
How to use glowskeleton/goblin-models with sam2:
# Use SAM2 with images import torch from sam2.sam2_image_predictor import SAM2ImagePredictor predictor = SAM2ImagePredictor.from_pretrained(glowskeleton/goblin-models) with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16): predictor.set_image(<your_image>) masks, _, _ = predictor.predict(<input_prompts>)# Use SAM2 with videos import torch from sam2.sam2_video_predictor import SAM2VideoPredictor predictor = SAM2VideoPredictor.from_pretrained(glowskeleton/goblin-models) with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16): state = predictor.init_state(<your_video>) # add new prompts and instantly get the output on the same frame frame_idx, object_ids, masks = predictor.add_new_points(state, <your_prompts>): # propagate the prompts to get masklets throughout the video for frame_idx, object_ids, masks in predictor.propagate_in_video(state): ... - Notebooks
- Google Colab
- Kaggle
Goblin models
ONNX artifacts for Goblin, a
GPU-accelerated node-based compositor. Everything Goblin's model installer
downloads lives here, so a given Goblin version pins exactly the artifacts it
was tested against rather than tracking upstream main.
Three groups.
sam2-video/ β Goblin re-exports for SAM2 video propagation
These are not upstream files. facebook/sam2.1-hiera-tiny has no published
ONNX export of the video path, so these were produced for Goblin:
| file | what it is |
|---|---|
memory_attention.onnx |
needed a real-valued RoPE rewrite β SAM2's complex tensors have no ONNX representation |
memory_encoder.onnx |
memory encoder export |
prompt_encoder_mask_decoder.onnx |
re-export carrying the obj_ptr output propagation needs, all four mask tokens, and the input_masks dense prompt |
*.f32 |
constant tensors dumped from the PyTorch checkpoint β not models |
The decoder here replaces the upstream one. The upstream build has no
obj_ptr output, so video propagation cannot run against it.
vitmatte/ β ViTMatte with Einsum rewritten as MatMul
model.onnx is Xenova/vitmatte-small-composition-1k
with its 24 Einsum nodes β 12 bhwc,hkc->bhwk and 12 bhwc,wkc->bhwk, ViT's
decomposed relative position bias β rewritten as broadcasting MatMul.
That single op was the reason the model could only run on CPU:
- CoreML cannot execute
Einsum, so it partitioned around all 24 (measured at ~51 partitions, no speedup over CPU). - DirectML has a documented
Einsumwrong-results bug (onnxruntime#19837) that silently corrupts the matte.
The rewrite is bit-identical on the CPU execution provider β max absolute
difference 0.000e+00 over random inputs β and introduces no new operator and no
opset change. Produced and verified by
tools/ml/rewrite_vitmatte_einsum.py,
which refuses to emit a model whose output drifts by more than 1e-4.
Goblin selects the execution provider from the graph rather than from a flag: a
model still containing Einsum runs on CPU regardless of settings, because a
wrong matte looks like a slightly different matte rather than an error.
sam2-upstream/ β mirror of the SAM2 image-mode files
Byte-for-byte copies of the ONNX from
onnx-community/sam2.1-hiera-tiny-ONNX,
mirrored so an install is self-contained and cannot change under a force-push
upstream. prompt_encoder_mask_decoder.onnx here is the original community
build; sam2-video/ holds the re-export that supersedes it.
Licensing
SAM 2 is Apache 2.0 (Meta). ViTMatte weights derive from
hustvl/vitmatte-small-composition-1k. Derived artifacts here carry their
upstream licenses; the export and rewrite tooling is part of Goblin.
- Downloads last month
- -