dylanebert
		
	commited on
		
		
					Commit 
							
							·
						
						bf7666a
	
1
								Parent(s):
							
							6b83d25
								
minify, update requirements
Browse files- README.md +11 -2
- data/anya_rgba.png +0 -0
- data/corgi.jpg +0 -0
- requirements.txt +55 -0
- run_imagedream.py +0 -32
- run_mvdream.py +0 -31
    	
        README.md
    CHANGED
    
    | @@ -17,12 +17,21 @@ This project can be used from other projects as follows. | |
| 17 | 
             
            import torch
         | 
| 18 | 
             
            from diffusers import DiffusionPipeline
         | 
| 19 |  | 
| 20 | 
            -
             | 
|  | |
| 21 | 
             
                "ashawkey/mvdream-sd2.1-diffusers",
         | 
| 22 | 
             
                custom_pipeline="dylanebert/multi_view_diffusion",
         | 
| 23 | 
             
                torch_dtype=torch.float16,
         | 
| 24 | 
             
                trust_remote_code=True,
         | 
| 25 | 
            -
            )
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 26 | 
             
            ```
         | 
| 27 |  | 
| 28 | 
             
            Original model card below.
         | 
|  | |
| 17 | 
             
            import torch
         | 
| 18 | 
             
            from diffusers import DiffusionPipeline
         | 
| 19 |  | 
| 20 | 
            +
            # Text to Multi-View Diffusion
         | 
| 21 | 
            +
            text_pipeline = DiffusionPipeline.from_pretrained(
         | 
| 22 | 
             
                "ashawkey/mvdream-sd2.1-diffusers",
         | 
| 23 | 
             
                custom_pipeline="dylanebert/multi_view_diffusion",
         | 
| 24 | 
             
                torch_dtype=torch.float16,
         | 
| 25 | 
             
                trust_remote_code=True,
         | 
| 26 | 
            +
            ).to("cuda")
         | 
| 27 | 
            +
             | 
| 28 | 
            +
            # Image to Multi-View Diffusion
         | 
| 29 | 
            +
            image_pipeline = DiffusionPipeline.from_pretrained(
         | 
| 30 | 
            +
                "ashawkey/imagedream-ipmv-diffusers",
         | 
| 31 | 
            +
                custom_pipeline="dylanebert/multi_view_diffusion",
         | 
| 32 | 
            +
                torch_dtype=torch.float16,
         | 
| 33 | 
            +
                trust_remote_code=True,
         | 
| 34 | 
            +
            ).to("cuda")
         | 
| 35 | 
             
            ```
         | 
| 36 |  | 
| 37 | 
             
            Original model card below.
         | 
    	
        data/anya_rgba.png
    DELETED
    
    | Binary file (32.9 kB) | 
|  | 
    	
        data/corgi.jpg
    DELETED
    
    | Binary file (18.8 kB) | 
|  | 
    	
        requirements.txt
    ADDED
    
    | @@ -0,0 +1,55 @@ | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            accelerate==0.28.0
         | 
| 2 | 
            +
            certifi==2024.2.2
         | 
| 3 | 
            +
            charset-normalizer==3.3.2
         | 
| 4 | 
            +
            diffusers==0.27.2
         | 
| 5 | 
            +
            einops==0.7.0
         | 
| 6 | 
            +
            executing==2.0.1
         | 
| 7 | 
            +
            filelock==3.13.3
         | 
| 8 | 
            +
            fsspec==2024.3.1
         | 
| 9 | 
            +
            huggingface-hub==0.22.2
         | 
| 10 | 
            +
            idna==3.6
         | 
| 11 | 
            +
            importlib_metadata==7.1.0
         | 
| 12 | 
            +
            Jinja2==3.1.3
         | 
| 13 | 
            +
            kiui==0.2.7
         | 
| 14 | 
            +
            lazy_loader==0.3
         | 
| 15 | 
            +
            markdown-it-py==3.0.0
         | 
| 16 | 
            +
            MarkupSafe==2.1.5
         | 
| 17 | 
            +
            mdurl==0.1.2
         | 
| 18 | 
            +
            mpmath==1.3.0
         | 
| 19 | 
            +
            networkx==3.2.1
         | 
| 20 | 
            +
            numpy==1.26.4
         | 
| 21 | 
            +
            nvidia-cublas-cu12==12.1.3.1
         | 
| 22 | 
            +
            nvidia-cuda-cupti-cu12==12.1.105
         | 
| 23 | 
            +
            nvidia-cuda-nvrtc-cu12==12.1.105
         | 
| 24 | 
            +
            nvidia-cuda-runtime-cu12==12.1.105
         | 
| 25 | 
            +
            nvidia-cudnn-cu12==8.9.2.26
         | 
| 26 | 
            +
            nvidia-cufft-cu12==11.0.2.54
         | 
| 27 | 
            +
            nvidia-curand-cu12==10.3.2.106
         | 
| 28 | 
            +
            nvidia-cusolver-cu12==11.4.5.107
         | 
| 29 | 
            +
            nvidia-cusparse-cu12==12.1.0.106
         | 
| 30 | 
            +
            nvidia-nccl-cu12==2.19.3
         | 
| 31 | 
            +
            nvidia-nvjitlink-cu12==12.4.99
         | 
| 32 | 
            +
            nvidia-nvtx-cu12==12.1.105
         | 
| 33 | 
            +
            objprint==0.2.3
         | 
| 34 | 
            +
            opencv-python==4.9.0.80
         | 
| 35 | 
            +
            packaging==24.0
         | 
| 36 | 
            +
            pillow==10.2.0
         | 
| 37 | 
            +
            psutil==5.9.8
         | 
| 38 | 
            +
            Pygments==2.17.2
         | 
| 39 | 
            +
            PyYAML==6.0.1
         | 
| 40 | 
            +
            regex==2023.12.25
         | 
| 41 | 
            +
            requests==2.31.0
         | 
| 42 | 
            +
            rich==13.7.1
         | 
| 43 | 
            +
            safetensors==0.4.2
         | 
| 44 | 
            +
            scipy==1.12.0
         | 
| 45 | 
            +
            sympy==1.12
         | 
| 46 | 
            +
            tokenizers==0.15.2
         | 
| 47 | 
            +
            torch==2.2.2
         | 
| 48 | 
            +
            tqdm==4.66.2
         | 
| 49 | 
            +
            transformers==4.39.2
         | 
| 50 | 
            +
            triton==2.2.0
         | 
| 51 | 
            +
            typing_extensions==4.10.0
         | 
| 52 | 
            +
            urllib3==2.2.1
         | 
| 53 | 
            +
            varname==0.13.0
         | 
| 54 | 
            +
            xformers==0.0.25.post1
         | 
| 55 | 
            +
            zipp==3.18.1
         | 
    	
        run_imagedream.py
    DELETED
    
    | @@ -1,32 +0,0 @@ | |
| 1 | 
            -
            import torch
         | 
| 2 | 
            -
            import kiui
         | 
| 3 | 
            -
            import numpy as np
         | 
| 4 | 
            -
            import argparse
         | 
| 5 | 
            -
            from pipeline import MVDreamPipeline
         | 
| 6 | 
            -
             | 
| 7 | 
            -
            pipe = MVDreamPipeline.from_pretrained(
         | 
| 8 | 
            -
                # "./weights_imagedream", # local weights
         | 
| 9 | 
            -
                "ashawkey/imagedream-ipmv-diffusers", # remote weights
         | 
| 10 | 
            -
                torch_dtype=torch.float16,
         | 
| 11 | 
            -
                trust_remote_code=True,
         | 
| 12 | 
            -
            )
         | 
| 13 | 
            -
            pipe = pipe.to("cuda")
         | 
| 14 | 
            -
             | 
| 15 | 
            -
             | 
| 16 | 
            -
            parser = argparse.ArgumentParser(description="ImageDream")
         | 
| 17 | 
            -
            parser.add_argument("image", type=str, default='data/anya_rgba.png')
         | 
| 18 | 
            -
            parser.add_argument("--prompt", type=str, default="")
         | 
| 19 | 
            -
            args = parser.parse_args()
         | 
| 20 | 
            -
             | 
| 21 | 
            -
            for i in range(5):
         | 
| 22 | 
            -
                input_image = kiui.read_image(args.image, mode='float')
         | 
| 23 | 
            -
                image = pipe(args.prompt, input_image, guidance_scale=5, num_inference_steps=30, elevation=0)
         | 
| 24 | 
            -
                grid = np.concatenate(
         | 
| 25 | 
            -
                    [
         | 
| 26 | 
            -
                        np.concatenate([image[0], image[2]], axis=0),
         | 
| 27 | 
            -
                        np.concatenate([image[1], image[3]], axis=0),
         | 
| 28 | 
            -
                    ],
         | 
| 29 | 
            -
                    axis=1,
         | 
| 30 | 
            -
                )
         | 
| 31 | 
            -
                # kiui.vis.plot_image(grid)
         | 
| 32 | 
            -
                kiui.write_image(f'test_imagedream_{i}.jpg', grid)
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
    	
        run_mvdream.py
    DELETED
    
    | @@ -1,31 +0,0 @@ | |
| 1 | 
            -
            import torch
         | 
| 2 | 
            -
            import kiui
         | 
| 3 | 
            -
            import numpy as np
         | 
| 4 | 
            -
            import argparse
         | 
| 5 | 
            -
            from pipeline import MVDreamPipeline
         | 
| 6 | 
            -
             | 
| 7 | 
            -
            pipe = MVDreamPipeline.from_pretrained(
         | 
| 8 | 
            -
                # "./weights_mvdream", # local weights
         | 
| 9 | 
            -
                'ashawkey/mvdream-sd2.1-diffusers', # remote weights
         | 
| 10 | 
            -
                torch_dtype=torch.float16,
         | 
| 11 | 
            -
                trust_remote_code=True,
         | 
| 12 | 
            -
            )
         | 
| 13 | 
            -
             | 
| 14 | 
            -
            pipe = pipe.to("cuda")
         | 
| 15 | 
            -
             | 
| 16 | 
            -
             | 
| 17 | 
            -
            parser = argparse.ArgumentParser(description="MVDream")
         | 
| 18 | 
            -
            parser.add_argument("prompt", type=str, default="a cute owl 3d model")
         | 
| 19 | 
            -
            args = parser.parse_args()
         | 
| 20 | 
            -
             | 
| 21 | 
            -
            for i in range(5):
         | 
| 22 | 
            -
                image = pipe(args.prompt, guidance_scale=5, num_inference_steps=30, elevation=0)
         | 
| 23 | 
            -
                grid = np.concatenate(
         | 
| 24 | 
            -
                    [
         | 
| 25 | 
            -
                        np.concatenate([image[0], image[2]], axis=0),
         | 
| 26 | 
            -
                        np.concatenate([image[1], image[3]], axis=0),
         | 
| 27 | 
            -
                    ],
         | 
| 28 | 
            -
                    axis=1,
         | 
| 29 | 
            -
                )
         | 
| 30 | 
            -
                # kiui.vis.plot_image(grid)
         | 
| 31 | 
            -
                kiui.write_image(f'test_mvdream_{i}.jpg', grid)
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  |