From fb34e91f0ef4ec8da8457299de4f822eaecfa1f3 Mon Sep 17 00:00:00 2001 From: kijai <40791699+kijai@users.noreply.github.com> Date: Wed, 18 Dec 2024 10:29:56 +0200 Subject: [PATCH] Support official scaled fp8 model --- hyvideo/modules/fp8_map.safetensors | Bin 0 -> 28320 bytes hyvideo/modules/fp8_optimization.py | 106 ++++++++++++++++++++++++++++ nodes.py | 7 +- 3 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 hyvideo/modules/fp8_map.safetensors create mode 100644 hyvideo/modules/fp8_optimization.py diff --git a/hyvideo/modules/fp8_map.safetensors b/hyvideo/modules/fp8_map.safetensors new file mode 100644 index 0000000000000000000000000000000000000000..602950ccca4057aedd338adb1cd63fedb4a2c448 GIT binary patch literal 28320 zcmbuHZ-{199mglpFw;WQ7x@RaaVIoy%iKTDeeRtxNC@dc3bBYxWSez&ZF6U4+a044 z-zv$ZUU;FBj12n(BEM~LWV_#Tu z?{3L&nxww0c~FC=D`CI zs*Y%rYK;gWP#w~lE8aGQ;AOe8f_#3@8Kx~JcrbNP9WyQ{kob#AD!5(Plfn*ir3ZOH zH7A82zYQT7+jtCWS}jQY4C$F@;IwQY8YaIVoHsmom{qqmsfVa;Xy`)0h-KkxQZQ%*doL zib5JinJ}gxLRDibpjwjx2viwG4~2${B|;K5Wz;hAwsfy@eN6lKDgf(TV7 z743cif$F5rc$&@q;AMq0ioX0lePdD>MInvCGb5A2C<!YB%96d}`?6h=`OR#&W0HcGmC`6erY$LWFqKhwW?WJr`5|BZMo}k> zDTq*2QUTSR6h=`>qv)YgNxA13(kMcvF)8;bLmGu=Mka+(l+q~blre=-l+q{ysyQi) zqLfC_L!*+yC`xG*A=8)?Mo~(m@XW}hFp5$d#W-b5VHBk_ihycP3Zp2cQS{KLq%ew7 z8b!!7CWTRy(kMJLGAWFrltwX58B-WVDUBkanv=pPN@)~5G%6{KqLfAvGL1=L6s0r@ z&x}k8qo|}&Gznu0B2;ys3aHkk00LD;(L-aBf|pg&C_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