-
Notifications
You must be signed in to change notification settings - Fork 109
Add FramePack sampler for FramePack-F1 #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Tested, and it works great! Edit: What method did you use to create the fp8 file? I've looked around but haven't found the process documented. |
|
@neph1 I put this code (derived from the native format loading) inside the Download Framepack node: state_dict = transformer.state_dict()
from safetensors.torch import save_file
save_file(state_dict, 'FramePack_F1_I2V_HY_20250503.safetensors')
with open('keys.txt', 'w', encoding='utf-8') as f:
for key in list(state_dict.keys()):
f.write(f"{key}\n")
params_to_keep = {"norm", "bias", "time_in", "vector_in",
"guidance_in", "txt_in", "img_in"}
# Convert parameters
converted_dict = {}
for key, tensor in state_dict.items():
if any(pattern in key for pattern in params_to_keep):
# Keep original dtype for specified parameters
converted_dict[key] = tensor
else:
# Convert to float8_e4m3fn for other parameters
if tensor.is_floating_point():
converted_dict[key] = tensor.to(torch.float8_e4m3fn)
else:
converted_dict[key] = tensor
# Save the converted model
save_file(converted_dict, "FramePack_F1_I2V_HY_20250503_fp8_e4m3fn.safetensors")
print("Successfully saved converted model")
raise 'debug'
``` |
|
@kijai are you ready to review this? |
|
When can this update be completed approximately |
|
After testing for a period of time, I felt that the F1 model had some flaws. Every second of the transition screen would experience shaking and unnatural transitions. I tried using the F1 sampler and the original FramePack model, which worked quite well. |
|
Can you add End image latent? |
This Pull request adds support for the new Framepack variant Framepack F1 (forward sampling) in a form of a new FramePackSamplerF1 node.
Here you can see a test result:
FramePack_00001.mp4
P.S. Converted Framepack F1 to kijai format for those who like to work with single files:
https://huggingface.co/kabachuha/FramePack_F1_I2V_HY_20250503_comfy/tree/main