CoolFace
Modelpublic

yitongl/sparse_quant_exp

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
run_inference.cpython-313.pyc56 linesDownload Raw Back to __pycache__
12�"�i���r�SrSSKJr SSKrSSKrSSKJr SrSrS3Sjr	SSjr4\S	:Xa
\"\5"55eg)zERun Wan T2V inference with the sparse FP4 checkpoint-700 transformer.�)�annotationsN)�PathaIn the video, a woman is elegantly showcasing her earrings, bringing attention to their intricate design with a gentle touch of her fingers. She is bathed in ambient purple and pink lighting, which casts a soft glow on her delicate features and enhances the vivid tones of her lipstick and eye makeup. Her hair is styled to frame her face smoothly, emphasizing the contours of her jawline and cheekbones. The background features a blurred neon light, adding an artistic and modern touch to the overall aesthetic.a�Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwardsc��U(aU[U5R5nUR5(a[UR	55$[SU35eSSKJn U"USUSS9n[[U5R	55$)Nz--weights does not exist: r)�hf_hub_downloadz/transformer/diffusion_pytorch_model.safetensors�model)�repo_id�filename�	local_dir�	repo_type)r�6expanduser�exists�str�resolve�FileNotFoundError�huggingface_hubr)r�weightsr7�pathrs     �rcheckpoints/hf_upload/sfp4_v4_sparse09_hpo_on_ours_p_init2050_checkpoint_700/standalone_inference/run_inference.py�_resolve_weightsr sy����G�}�'�'�)���;�;�=�=��t�|�|�~�&�&��"<�T�F� C�D�D�/���B���	�D��t�D�z�!�!�#�$�$�c�D�[R"5nURSSS9 URSSSS9 URSSS9 URS	S8SS9 URS[S9 URS
[S9 URSSS9 URS[9SS9 URS[10SS9 URS[11SS9 URS[12SS9 URS[13SS9 URS[SS9 URS[SS9 URS[14S S9 URS![S"S9 URS#[15S$S9 URS%[16S$S9 URS&[17S$S9 URS'S(S)S*9 URS+S(S,S*9 UR5n[RRS-S.5 [RRS/S05 [URURUR5nS1S2KJn UR#UR$UR&UR(UR*US,S,UR,UR.UR0UR2S39nUR5UR6UR8UR:S)S,UR<UR>UR@URBURDURFURHS49n[KU5 g1)5Nz	--repo-idzyitongl/sparse_quant_exp)�defaultz--model-pathz Wan-AI/Wan2.1-T2V-1.3B-Diffusersz#Base Wan Diffusers model repo/path.)r�helpz	--weightsz--local-dirz(checkpoints/hf_download/sparse_quant_expz?Local Hugging Face download directory for the uploaded weights.z--promptz--negative-promptz
--output-pathzoutputs/sfp4_checkpoint_700z--heighti�)�typerz--widthi@z--num-frames�Mz--num-inference-steps�2z--fps�z--guidance-scaleg@z--flow-shiftg�?z--seedi�z--vsa-sparsityg�������?z18--num-gpus�z	--sp-sizez	--tp-sizez--text-encoder-cpu-offload�19store_trueT)�actionrz--pin-cpu-memoryF�FASTVIDEO_ATTENTION_BACKEND�SPARSE_FP4_OURS_P_ATTN�$FASTVIDEO_SPARSE_FP4_USE_HIGH_PREC_O�1r)�VideoGenerator)�20model_path�num_gpus�sp_size�tp_size�init_weights_from_safetensors�dit_cpu_offload�vae_cpu_offload�text_encoder_cpu_offload�pin_cpu_memory�21flow_shift�VSA_sparsity)�prompt�negative_prompt�output_path�22save_video�
return_frames�height�width�23num_frames�num_inference_steps�fps�guidance_scale�seed)&�argparse�ArgumentParser�add_argument�DEFAULT_PROMPT�DEFAULT_NEGATIVE_PROMPT�int�float�24parse_args�os�environ�25setdefaultrrrr26�	fastvideor%�from_pretrainedr&r'r(r)r-r.r/�vsa_sparsity�generate_videor1r2r3r6r7r8r9r:r;r<�print)�parser�args�weights_pathr%�	generator�results      r�mainrR2s��
�
$�
$�
&�F�27����-G��H�28����2�
2���29����T��2�30����:�
N���31���32�N��;�33���+�5L��M�34����1N��O�35���36��c��:�37���	��S��9�38����S�"��=�39���/�c�2��F�40����c�2��6�41���*����D�42����U�C��@�43����s�D��9�44���(�u�c��B�45����3���:�46����#�q��9�47����#�q��9�48���4�\�SW��X�49���*�<���O�����D��J�J���7�9Q�R��J�J���@�#�F�#�D�L�L�$�,�,����O�L�(��.�.��?�?����������&2���!%�!>�!>��*�*��?�?��&�&�/��I��
%�
%��{�{��,�,��$�$����{�{��j�j��?�?� �4�4��H�H��*�*�
�Y�Y�&�
�F�50�&�M�r�__main__)rrrz51str | Noner52r�returnr)rTrB)
�__doc__�53__future__rr=rE�pathlibrr@rArrR�__name__�54SystemExit�rr�<module>r[sP��K�"��	����$��%�$E
�P�z��55�T�V�56��r