Associate Text Viewer with another filetype

Hi

I want have the Viewer to display the .SAFETENSORS file type as text. Is there a way to do that?

I tried setting it as a txt file, but there/s still no preview. There are many occasions where your users may wish to treat certain binary files as text, simply to view the file's headers. My specific use case is working with AI files. I'd like to click a safetensor and be able to see the first 20-30k or so to determine the file's base model.

Another use case is examining the first 10k of a PNG image to examine its iHDR for the generative information it often contains.

Preferences / Viewer / Plugins / Text, click Configure and make sure the Hex viewer is enabled.

If the viewer pane (not the standalone viewer) is being used, you'll may also need to turn off Preferences / Viewer / Viewer Pane: Display shell icons.

You should then get a hex + text view of any binary files that don't have a viewer for their format installed.

1 Like

Hi Leo, You're a champ!! Thank you so much.

You know, the AI community has damn-all for useful tools. DO is the best NC-type tool I've used since Norton folded, and I've been doing this for a long, long time.

There a real need in the AI community for file handling tools. The same holds true for the 3D community (ZBrush, 3DS MAX, Poser, DAZ 3D, etc.)

We have tons of files and often very little in the way of useful identifiers, depending on the app.

If there was a plug-in that would identify Stable Diffusion file types and also identify the file's base model, I'd sure as hell buy it.

I can code some, but that work is beyond my skill set. I used Phind.com to make python scripts to help me learn a file's base model, but they're hit or miss. The same holds true for the file's type. Virtually every SD file is a .safetensor (there are some .PT's around), it's just a python compression container (?). I don't have the time or enough skill to modify the scripts to cover the many, many edge cases.

The repos for ComfyUI and InvokeAI have the code to make both determinations. Somewhere.

If someone made a plugin that'd display the useful metadata for the safetensors and it noted the base models, their purpose (LORA, LYCORIS, etc.), and for the Lora and Lycoris types, any triggers or training words, I'd put out a couple hundred for it. Trust me, it would be saleable as a lower price once the people on Civitai hear about it.