Skip to content

Conversation

@kabachuha
Copy link
Contributor

@kabachuha kabachuha commented May 5, 2025

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

@kabachuha kabachuha changed the base branch from dev to main May 5, 2025 19:23
@neph1
Copy link

neph1 commented May 7, 2025

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.

@kabachuha
Copy link
Contributor Author

@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'
    ```

@kabachuha
Copy link
Contributor Author

@kijai are you ready to review this?

@kajfblsdkgnlsndg
Copy link

When can this update be completed approximately

@kajfblsdkgnlsndg
Copy link

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.

@wardboumans
Copy link

Can you add End image latent?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants