Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	Upload app.py with huggingface_hub
Browse files
    	
        app.py
    CHANGED
    
    | 
         @@ -10,11 +10,25 @@ 
     | 
|
| 10 | 
         
             
            # its affiliates is strictly prohibited.
         
     | 
| 11 | 
         
             
            #
         
     | 
| 12 | 
         
             
            # For permission requests, please contact [email protected], [email protected], [email protected], [email protected].
         
     | 
| 
         | 
|
| 13 | 
         
             
            import time
         
     | 
| 
         | 
|
| 14 | 
         
             
            import gradio as gr
         
     | 
| 
         | 
|
| 15 | 
         
             
            from luciddreamer import LucidDreamer
         
     | 
| 16 | 
         | 
| 17 | 
         | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 18 | 
         
             
            css = """
         
     | 
| 19 | 
         
             
            #run-button {
         
     | 
| 20 | 
         
             
              background: coral;
         
     | 
| 
         @@ -24,7 +38,6 @@ css = """ 
     | 
|
| 24 | 
         | 
| 25 | 
         
             
            ld = LucidDreamer()
         
     | 
| 26 | 
         | 
| 27 | 
         
            -
             
     | 
| 28 | 
         
             
            with gr.Blocks(css=css) as demo:
         
     | 
| 29 | 
         | 
| 30 | 
         
             
                gr.HTML(
         
     | 
| 
         @@ -265,4 +278,4 @@ with gr.Blocks(css=css) as demo: 
     | 
|
| 265 | 
         | 
| 266 | 
         | 
| 267 | 
         
             
            if __name__ == '__main__':
         
     | 
| 268 | 
         
            -
                demo.queue(max_size=20).launch(server_port=16011)
         
     | 
| 
         | 
|
| 10 | 
         
             
            # its affiliates is strictly prohibited.
         
     | 
| 11 | 
         
             
            #
         
     | 
| 12 | 
         
             
            # For permission requests, please contact [email protected], [email protected], [email protected], [email protected].
         
     | 
| 13 | 
         
            +
            import os
         
     | 
| 14 | 
         
             
            import time
         
     | 
| 15 | 
         
            +
            import pathlib
         
     | 
| 16 | 
         
             
            import gradio as gr
         
     | 
| 17 | 
         
            +
            from huggingface_hub import snapshot_download
         
     | 
| 18 | 
         
             
            from luciddreamer import LucidDreamer
         
     | 
| 19 | 
         | 
| 20 | 
         | 
| 21 | 
         
            +
            root = pathlib.Path(__file__).parent
         
     | 
| 22 | 
         
            +
            example_root = os.path.joint(root, 'examples')
         
     | 
| 23 | 
         
            +
            ckpt_root = os.path.join(root, 'stablediffusion')
         
     | 
| 24 | 
         
            +
            if not CHECKPOINTS_PATH.exists():
         
     | 
| 25 | 
         
            +
                snapshot_download(repo_id="ironjr/LucidDreamerDemo", repo_type="model", local_dir=example_root)
         
     | 
| 26 | 
         
            +
                snapshot_download(repo_id="ironjr/BlazingDriveV11m", repo_type="model", local_dir=os.path.join(ckpt_root, 'Blazing Drive V11m'))
         
     | 
| 27 | 
         
            +
                snapshot_download(repo_id="ironjr/RealCartoon-PixarV5", repo_type="model", local_dir=os.path.join(ckpt_root, 'RealCartoon-Pixar V5'))
         
     | 
| 28 | 
         
            +
                snapshot_download(repo_id="ironjr/RealisticVisionV5-1", repo_type="model", local_dir=os.path.join(ckpt_root, 'Realistic Vision V5.1'))
         
     | 
| 29 | 
         
            +
                snapshot_download(repo_id="runwayml/stable-diffusion-inpainting", repo_type="model", local_dir=os.path.join(ckpt_root, 'SD1-5'))
         
     | 
| 30 | 
         
            +
             
     | 
| 31 | 
         
            +
             
     | 
| 32 | 
         
             
            css = """
         
     | 
| 33 | 
         
             
            #run-button {
         
     | 
| 34 | 
         
             
              background: coral;
         
     | 
| 
         | 
|
| 38 | 
         | 
| 39 | 
         
             
            ld = LucidDreamer()
         
     | 
| 40 | 
         | 
| 
         | 
|
| 41 | 
         
             
            with gr.Blocks(css=css) as demo:
         
     | 
| 42 | 
         | 
| 43 | 
         
             
                gr.HTML(
         
     | 
| 
         | 
|
| 278 | 
         | 
| 279 | 
         | 
| 280 | 
         
             
            if __name__ == '__main__':
         
     | 
| 281 | 
         
            +
                demo.queue(max_size=20).launch(server_port=16011)
         
     |