MonkeyMagic100 commited on
Commit
1b28b39
·
verified ·
1 Parent(s): ac35b2a

Publish Localboy SAM 3.1 INT8 conversion

Browse files

Validated mixed INT8/FP16 checkpoint (957,880,192 bytes), SAM licence, provenance and checksum manifest. Custom localboy-sam-q8-v1 loader required; Localboy app integration is in development.

Files changed (4) hide show
  1. LICENSE +61 -0
  2. README.md +57 -0
  3. manifest.json +43 -0
  4. sam3.1_multiplex_localboy_q8.safetensors +3 -0
LICENSE CHANGED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ SAM License
2
+ Last Updated: November 19, 2025
3
+
4
+ “Agreement” means the terms and conditions for use, reproduction, distribution and modification of the SAM Materials set forth herein.
5
+
6
+
7
+ “SAM Materials” means, collectively, Documentation and the models, software and algorithms, including machine-learning model code, trained model weights, inference-enabling code, training-enabling code, fine-tuning enabling code, and other elements of the foregoing distributed by Meta and made available under this Agreement.
8
+
9
+ “Documentation” means the specifications, manuals and documentation accompanying
10
+ SAM Materials distributed by Meta.
11
+
12
+
13
+ “Licensee” or “you” means you, or your employer or any other person or entity (if you are entering into this Agreement on such person or entity’s behalf), of the age required under applicable laws, rules or regulations to provide legal consent and that has legal authority to bind your employer or such other person or entity if you are entering in this Agreement on their behalf.
14
+
15
+
16
+ “Meta” or “we” means Meta Platforms Ireland Limited (if you are located in or, if you are an entity, your principal place of business is in the EEA or Switzerland) or Meta Platforms, Inc. (if you are located outside of the EEA or Switzerland).
17
+
18
+
19
+ “Sanctions” means any economic or trade sanctions or restrictions administered or enforced by the United States (including the Office of Foreign Assets Control of the U.S. Department of the Treasury (“OFAC”), the U.S. Department of State and the U.S. Department of Commerce), the United Nations, the European Union, or the United Kingdom.
20
+
21
+
22
+ “Trade Controls” means any of the following: Sanctions and applicable export and import controls.
23
+
24
+ By using or distributing any portion or element of the SAM Materials, you agree to be bound by this Agreement.
25
+
26
+
27
+ 1. License Rights and Redistribution.
28
+
29
+
30
+ a. Grant of Rights. You are granted a non-exclusive, worldwide, non-transferable and royalty-free limited license under Meta’s intellectual property or other rights owned by Meta embodied in the SAM Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the SAM Materials.
31
+
32
+ b. Redistribution and Use.
33
+ i. Distribution of SAM Materials, and any derivative works thereof, are subject to the terms of this Agreement. If you distribute or make the SAM Materials, or any derivative works thereof, available to a third party, you may only do so under the terms of this Agreement and you shall provide a copy of this Agreement with any such SAM Materials.
34
+
35
+
36
+ ii. If you submit for publication the results of research you perform on, using, or otherwise in connection with SAM Materials, you must acknowledge the use of SAM Materials in your publication.
37
+
38
+
39
+ iii. Your use of the SAM Materials must comply with applicable laws and regulations, including Trade Control Laws and applicable privacy and data protection laws.
40
+ iv. Your use of the SAM Materials will not involve or encourage others to reverse engineer, decompile or discover the underlying components of the SAM Materials.
41
+ v. You are not the target of Trade Controls and your use of SAM Materials must comply with Trade Controls. You agree not to use, or permit others to use, SAM Materials for any activities subject to the International Traffic in Arms Regulations (ITAR) or end uses prohibited by Trade Controls, including those related to military or warfare purposes, nuclear industries or applications, espionage, or the development or use of guns or illegal weapons.
42
+ 2. User Support. Your use of the SAM Materials is done at your own discretion; Meta does not process any information nor provide any service in relation to such use. Meta is under no obligation to provide any support services for the SAM Materials. Any support provided is “as is”, “with all faults”, and without warranty of any kind.
43
+
44
+
45
+ 3. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE SAM MATERIALS AND ANY OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OF ANY KIND, AND META DISCLAIMS ALL WARRANTIES OF ANY KIND, BOTH EXPRESS AND IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING THE SAM MATERIALS AND ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE SAM MATERIALS AND ANY OUTPUT AND RESULTS.
46
+
47
+ 4. Limitation of Liability. IN NO EVENT WILL META OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY DIRECT OR INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF ANY OF THE FOREGOING.
48
+
49
+ 5. Intellectual Property.
50
+
51
+
52
+ a. Subject to Meta’s ownership of SAM Materials and derivatives made by or for Meta, with respect to any derivative works and modifications of the SAM Materials that are made by you, as between you and Meta, you are and will be the owner of such derivative works and modifications.
53
+
54
+ b. If you institute litigation or other proceedings against Meta or any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the SAM Materials, outputs or results, or any portion of any of the foregoing, constitutes infringement of intellectual property or other rights owned or licensable by you, then any licenses granted to you under this Agreement shall terminate as of the date such litigation or claim is filed or instituted. You will indemnify and hold harmless Meta from and against any claim by any third party arising out of or related to your use or distribution of the SAM Materials.
55
+
56
+ 6. Term and Termination. The term of this Agreement will commence upon your acceptance of this Agreement or access to the SAM Materials and will continue in full force and effect until terminated in accordance with the terms and conditions herein. Meta may terminate this Agreement if you are in breach of any term or condition of this Agreement. Upon termination of this Agreement, you shall delete and cease use of the SAM Materials. Sections 3, 4 and 7 shall survive the termination of this Agreement.
57
+
58
+ 7. Governing Law and Jurisdiction. This Agreement will be governed and construed under the laws of the State of California without regard to choice of law principles, and the UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement. The courts of California shall have exclusive jurisdiction of any dispute arising out of this Agreement.
59
+
60
+
61
+ 8. Modifications and Amendments. Meta may modify this Agreement from time to time; provided that they are similar in spirit to the current version of the Agreement, but may differ in detail to address new problems or concerns. All such changes will be effective immediately. Your continued use of the SAM Materials after any modification to this Agreement constitutes your agreement to such modification. Except as provided in this Agreement, no modification or addition to any provision of this Agreement will be binding unless it is in writing and signed by an authorized representative of both you and Meta.
README.md CHANGED
@@ -2,4 +2,61 @@
2
  license: other
3
  license_name: sam-license
4
  license_link: LICENSE
 
 
 
 
 
 
 
5
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  license: other
3
  license_name: sam-license
4
  license_link: LICENSE
5
+ base_model: Comfy-Org/sam3
6
+ tags:
7
+ - sam3
8
+ - sam3.1
9
+ - int8
10
+ - apple-silicon
11
+ - experimental
12
  ---
13
+ # Localboy SAM 3.1 INT8
14
+
15
+ Unofficial mixed INT8/FP16 conversion for Localboy's SAM 3.1 integration.
16
+ This is not an official Meta release or a stock ComfyUI checkpoint. Derived from
17
+ [Comfy-Org/sam3](https://huggingface.co/Comfy-Org/sam3/tree/7bb8374780a725b4353ed31f3a9395c9742b5621),
18
+ revision `7bb8374780a725b4353ed31f3a9395c9742b5621`, checkpoint
19
+ `sam3.1_multiplex_fp16.safetensors`. The included [SAM License](LICENSE) applies
20
+ to these derivative weights, including its redistribution and use conditions.
21
+ Meta supplies the underlying SAM model; Localboy supplies this conversion.
22
+
23
+ Custom format `localboy-sam-q8-v1`: signed symmetric INT8 per output row for
24
+ 487 matrix weights; `<original-key>.localboy_scale` is a FP32 row scale.
25
+ Reconstruction is `q.float() * scale[:, None]`. 1,103 other tensors retain FP16.
26
+ The file is 957,880,192 bytes. SHA256:
27
+ abd739893274423df88f9421b65970824df2d2f2d37a0d815e3a129da900c69d.
28
+
29
+ ## Compatibility
30
+
31
+ This file needs Localboy's matching `localboy-sam-q8-v1` loader. A standard
32
+ ComfyUI/Meta loader cannot directly consume it. The integration uses Python,
33
+ PyTorch and Metal; this repository does not provide a Python-free SAM runtime.
34
+ Localboy application integration is in development; older app releases using
35
+ the FP16 filename will not automatically load this file. Install through a
36
+ Localboy version that explicitly supports this conversion.
37
+
38
+ The checkpoint includes the detector, text encoder and SAM 3.1 Multiplex tracker.
39
+ Internal model resolution remains 1008x1008. Frames and temporal history are not
40
+ reduced by the conversion. Non-quantized tensors are retained exactly from the
41
+ source. Source SHA256:
42
+ `9ba99c92703c2e8b4f47de2d34a539bb8e18923049e238b780d70dbe6368eb03`.
43
+
44
+ For independent inspection, each INT8 matrix is reconstructed as
45
+ `(q.float() * scale[:, None]).half()`, omitting the `.localboy_scale` entries from
46
+ the reconstructed state dictionary. This describes the numerical format, not a
47
+ complete inference loader. Compared with the original 1,745,546,848-byte FP16
48
+ file, this saves 787,666,656 bytes (45.12%). Download integrity details are in
49
+ [manifest.json](manifest.json).
50
+
51
+ ## Initial local validation
52
+
53
+ On an Apple M5 Pro, three 48-frame selection cases across two source clips took
54
+ 20.09–20.24 seconds with the experimental large-attention routing and custom
55
+ Metal tensor kernels, compared with 63.74–66.43 seconds in the current runtime.
56
+ The custom tensor path also quantizes selected vision activations to INT8.
57
+ Mean thresholded-mask IoU against the current FP16 implementation was 99.65%
58
+ for a face and 99.96–99.97% for the two person-selection cases. These are limited
59
+ agreement measurements, not ground-truth accuracy or a general speed guarantee.
60
+ The largest speed improvement came from fused attention dispatch; INT8 weights
61
+ primarily reduce storage. Other chips, long clips, multiple objects, click/paint
62
+ prompts and complete edited-video output have not been validated.
manifest.json ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schemaVersion": 1,
3
+ "status": "experimental",
4
+ "format": "localboy-sam-q8-v1",
5
+ "source": {
6
+ "repository": "Comfy-Org/sam3",
7
+ "revision": "7bb8374780a725b4353ed31f3a9395c9742b5621",
8
+ "sha256": "9ba99c92703c2e8b4f47de2d34a539bb8e18923049e238b780d70dbe6368eb03"
9
+ },
10
+ "files": [
11
+ {
12
+ "path": "sam3.1_multiplex_localboy_q8.safetensors",
13
+ "bytes": 957880192,
14
+ "sha256": "abd739893274423df88f9421b65970824df2d2f2d37a0d815e3a129da900c69d"
15
+ },
16
+ {
17
+ "path": "LICENSE",
18
+ "bytes": 7353,
19
+ "sha256": "4dea99bfaa016e21bc860d73f344236bd1e5c4977d1a9a8fd32f822b500ae1be"
20
+ },
21
+ {
22
+ "path": "README.md",
23
+ "bytes": 3112,
24
+ "sha256": "8cd011e70a6ca3de9893b7cfb3b0b57e1834036083d1f816e8b27603a324c609"
25
+ }
26
+ ],
27
+ "runtime": {
28
+ "status": "application-integration-in-development",
29
+ "requires": "Localboy localboy-sam-q8-v1 loader, Python, PyTorch; Metal for accelerated execution"
30
+ },
31
+ "hosting": {
32
+ "repository": "MonkeyMagic100/localboy-sam3.1-int8"
33
+ },
34
+ "inputResolution": [
35
+ 1008,
36
+ 1008
37
+ ],
38
+ "quantization": {
39
+ "weightBits": 8,
40
+ "scales": "float32",
41
+ "unquantizedTensors": "float16"
42
+ }
43
+ }
sam3.1_multiplex_localboy_q8.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:abd739893274423df88f9421b65970824df2d2f2d37a0d815e3a129da900c69d
3
+ size 957880192