Spaces:
				
			
			
	
			
			
		Paused
		
	
	
	
			
			
	
	
	
	
		
		
		Paused
		
	
		bubbliiiing
		
	commited on
		
		
					Commit 
							
							·
						
						08038f7
	
1
								Parent(s):
							
							19fe404
								
add requirements
Browse files- app.py +4 -4
 - easyanimate/ui/ui.py +3 -3
 - requirements.txt +23 -0
 
    	
        app.py
    CHANGED
    
    | 
         @@ -1,11 +1,11 @@ 
     | 
|
| 1 | 
         
             
            import time 
         
     | 
| 2 | 
         | 
| 3 | 
         
             
            from easyanimate.api.api import infer_forward_api, update_diffusion_transformer_api, update_edition_api
         
     | 
| 4 | 
         
            -
            from easyanimate.ui.ui import ui_modelscope,  
     | 
| 5 | 
         | 
| 6 | 
         
             
            if __name__ == "__main__":
         
     | 
| 7 | 
         
             
                # Choose the ui mode  
         
     | 
| 8 | 
         
            -
                ui_mode = " 
     | 
| 9 | 
         
             
                # Server ip
         
     | 
| 10 | 
         
             
                server_name = "0.0.0.0"
         
     | 
| 11 | 
         
             
                server_port = 7860
         
     | 
| 
         @@ -18,8 +18,8 @@ if __name__ == "__main__": 
     | 
|
| 18 | 
         | 
| 19 | 
         
             
                if ui_mode == "modelscope":
         
     | 
| 20 | 
         
             
                    demo, controller = ui_modelscope(edition, config_path, model_name, savedir_sample)
         
     | 
| 21 | 
         
            -
                elif ui_mode == " 
     | 
| 22 | 
         
            -
                    demo, controller =  
     | 
| 23 | 
         
             
                else:
         
     | 
| 24 | 
         
             
                    demo, controller = ui()
         
     | 
| 25 | 
         | 
| 
         | 
|
| 1 | 
         
             
            import time 
         
     | 
| 2 | 
         | 
| 3 | 
         
             
            from easyanimate.api.api import infer_forward_api, update_diffusion_transformer_api, update_edition_api
         
     | 
| 4 | 
         
            +
            from easyanimate.ui.ui import ui_modelscope, ui_eas, ui
         
     | 
| 5 | 
         | 
| 6 | 
         
             
            if __name__ == "__main__":
         
     | 
| 7 | 
         
             
                # Choose the ui mode  
         
     | 
| 8 | 
         
            +
                ui_mode = "eas"
         
     | 
| 9 | 
         
             
                # Server ip
         
     | 
| 10 | 
         
             
                server_name = "0.0.0.0"
         
     | 
| 11 | 
         
             
                server_port = 7860
         
     | 
| 
         | 
|
| 18 | 
         | 
| 19 | 
         
             
                if ui_mode == "modelscope":
         
     | 
| 20 | 
         
             
                    demo, controller = ui_modelscope(edition, config_path, model_name, savedir_sample)
         
     | 
| 21 | 
         
            +
                elif ui_mode == "eas":
         
     | 
| 22 | 
         
            +
                    demo, controller = ui_eas(edition, config_path, model_name, savedir_sample)
         
     | 
| 23 | 
         
             
                else:
         
     | 
| 24 | 
         
             
                    demo, controller = ui()
         
     | 
| 25 | 
         | 
    	
        easyanimate/ui/ui.py
    CHANGED
    
    | 
         @@ -691,7 +691,7 @@ def post_eas( 
     | 
|
| 691 | 
         
             
                return outputs
         
     | 
| 692 | 
         | 
| 693 | 
         | 
| 694 | 
         
            -
            class  
     | 
| 695 | 
         
             
                def __init__(self, edition, config_path, model_name, savedir_sample):
         
     | 
| 696 | 
         
             
                    self.savedir_sample = savedir_sample
         
     | 
| 697 | 
         
             
                    os.makedirs(self.savedir_sample, exist_ok=True)
         
     | 
| 
         @@ -734,8 +734,8 @@ class EasyAnimateController_HuggingFace: 
     | 
|
| 734 | 
         
             
                        return gr.Image.update(visible=False, value=None), gr.Video.update(value=save_sample_path, visible=True), "Success"
         
     | 
| 735 | 
         | 
| 736 | 
         | 
| 737 | 
         
            -
            def  
     | 
| 738 | 
         
            -
                controller =  
     | 
| 739 | 
         | 
| 740 | 
         
             
                with gr.Blocks(css=css) as demo:
         
     | 
| 741 | 
         
             
                    gr.Markdown(
         
     | 
| 
         | 
|
| 691 | 
         
             
                return outputs
         
     | 
| 692 | 
         | 
| 693 | 
         | 
| 694 | 
         
            +
            class EasyAnimateController_EAS:
         
     | 
| 695 | 
         
             
                def __init__(self, edition, config_path, model_name, savedir_sample):
         
     | 
| 696 | 
         
             
                    self.savedir_sample = savedir_sample
         
     | 
| 697 | 
         
             
                    os.makedirs(self.savedir_sample, exist_ok=True)
         
     | 
| 
         | 
|
| 734 | 
         
             
                        return gr.Image.update(visible=False, value=None), gr.Video.update(value=save_sample_path, visible=True), "Success"
         
     | 
| 735 | 
         | 
| 736 | 
         | 
| 737 | 
         
            +
            def ui_eas(edition, config_path, model_name, savedir_sample):
         
     | 
| 738 | 
         
            +
                controller = EasyAnimateController_EAS(edition, config_path, model_name, savedir_sample)
         
     | 
| 739 | 
         | 
| 740 | 
         
             
                with gr.Blocks(css=css) as demo:
         
     | 
| 741 | 
         
             
                    gr.Markdown(
         
     | 
    	
        requirements.txt
    ADDED
    
    | 
         @@ -0,0 +1,23 @@ 
     | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
| 
         | 
|
| 1 | 
         
            +
            Pillow
         
     | 
| 2 | 
         
            +
            einops
         
     | 
| 3 | 
         
            +
            safetensors
         
     | 
| 4 | 
         
            +
            timm
         
     | 
| 5 | 
         
            +
            tomesd
         
     | 
| 6 | 
         
            +
            accelerate
         
     | 
| 7 | 
         
            +
            torch>=2.2.0
         
     | 
| 8 | 
         
            +
            torchdiffeq
         
     | 
| 9 | 
         
            +
            torchsde
         
     | 
| 10 | 
         
            +
            xformers
         
     | 
| 11 | 
         
            +
            decord
         
     | 
| 12 | 
         
            +
            datasets
         
     | 
| 13 | 
         
            +
            numpy
         
     | 
| 14 | 
         
            +
            scikit-image
         
     | 
| 15 | 
         
            +
            opencv-python
         
     | 
| 16 | 
         
            +
            omegaconf
         
     | 
| 17 | 
         
            +
            SentencePiece
         
     | 
| 18 | 
         
            +
            albumentations
         
     | 
| 19 | 
         
            +
            imageio[ffmpeg]
         
     | 
| 20 | 
         
            +
            imageio[pyav]
         
     | 
| 21 | 
         
            +
            tensorboard
         
     | 
| 22 | 
         
            +
            diffusers==0.27.0
         
     | 
| 23 | 
         
            +
            transformers==4.37.2
         
     |