Giter VIP home page Giter VIP logo

Comments (10)

grauho avatar grauho commented on June 15, 2024 4

Alright here it is, feel free to give it a try. I was able to use it to convert both I64 and F64 containing models to something sdcpp could work with:

https://github.com/grauho/sdc

from stable-diffusion.cpp.

grauho avatar grauho commented on June 15, 2024 3

I've written a small converter program in C that re-encodes entire safetensor files that does seem to do the job, once I put in handling for those using big-endian systems I'll publish it. Having trouble getting similar logic to work a la carte at tensor loading time in sdcpp though.

from stable-diffusion.cpp.

red-scorp avatar red-scorp commented on June 15, 2024 1

https://civitai.com/models/8124?modelVersionId=87886
https://civitai.com/models/7371/rev-animated

Look for the bigger files, like 4-5GB. they often are FP64

from stable-diffusion.cpp.

Cyberhan123 avatar Cyberhan123 commented on June 15, 2024

Can you manually set the type to f32?

from stable-diffusion.cpp.

FrankEscobar avatar FrankEscobar commented on June 15, 2024

I have the same issue with a model called revAnimated_v122 but trying to convert it to F32 or F16 it gets corrupt and takes only 809Kb

Did you managed to fix it?

from stable-diffusion.cpp.

askmyteapot avatar askmyteapot commented on June 15, 2024

Having this issue too with other models in the SD1.5 family.

Could this be looked at?

from stable-diffusion.cpp.

grauho avatar grauho commented on June 15, 2024

I suspect this has to do with GGML currently only having support for up to 32-bit width integer and float types in it's ggml_type. It might be possible if one is willing to accept a loss in precision to convert down to a 32-bit float, provided it does not exceed FLT_MAX, via a callback in the sdcpp load_tensors function.

from stable-diffusion.cpp.

grauho avatar grauho commented on June 15, 2024

Could someone please link a model where they are having the F64 problem? I think I've put together a fix that at least seems to work with the LoRAs I have that use I64.

from stable-diffusion.cpp.

SA-j00u avatar SA-j00u commented on June 15, 2024

https://github.com/grauho/sdc

can you add converting to fp16 too?

from stable-diffusion.cpp.

grauho avatar grauho commented on June 15, 2024

https://github.com/grauho/sdc

can you add converting to fp16 too?

It now has handling to convert down into F16 as well as BF16 using the -f, --float-out switch, although with the caveat that if your system isn't using IEEE format floats and doubles it might not get the conversion right. Don't use the --replace option unless you want to risk losing data.

from stable-diffusion.cpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.