models_root command line argument
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -14,3 +14,4 @@ | ||||
| *.egg | ||||
| dist | ||||
| build | ||||
| README | ||||
|   | ||||
							
								
								
									
										8
									
								
								README.md
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								README.md
									
									
									
									
										vendored
									
									
								
							| @@ -37,14 +37,14 @@ text = "a comfy chair that looks like an avocado" | ||||
| image = model.generate_image(text) | ||||
| display(image) | ||||
| ``` | ||||
|  | ||||
|  | ||||
|  | ||||
| ```python | ||||
| text = "trail cam footage of gollum eating watermelon" | ||||
| image = model.generate_image(text, seed=1) | ||||
| display(image) | ||||
| ``` | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| ### Command Line | ||||
| @@ -54,9 +54,9 @@ Use `image_from_text.py` to generate images from the command line. | ||||
| ```bash | ||||
| $ python image_from_text.py --text='artificial intelligence' --seed=7 | ||||
| ``` | ||||
|  | ||||
|  | ||||
|  | ||||
| ```bash | ||||
| $ python image_from_text.py --text='court sketch of godzilla on trial' --mega | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @@ -12,6 +12,7 @@ parser.set_defaults(mega=False) | ||||
| parser.add_argument('--text', type=str, default='alien life') | ||||
| parser.add_argument('--seed', type=int, default=-1) | ||||
| parser.add_argument('--image_path', type=str, default='generated') | ||||
| parser.add_argument('--models_root', type=str, default='pretrained') | ||||
| parser.add_argument('--token_count', type=int, default=256) # for debugging | ||||
|  | ||||
|  | ||||
| @@ -38,11 +39,12 @@ def generate_image( | ||||
|     text: str, | ||||
|     seed: int, | ||||
|     image_path: str, | ||||
|     models_root: str, | ||||
|     token_count: int | ||||
| ): | ||||
|     model = MinDalle( | ||||
|         is_mega=is_mega,  | ||||
|         models_root='pretrained', | ||||
|         models_root=models_root, | ||||
|         is_reusable=False, | ||||
|         sample_token_count=token_count, | ||||
|         is_verbose=True | ||||
| @@ -65,5 +67,6 @@ if __name__ == '__main__': | ||||
|         text=args.text, | ||||
|         seed=args.seed, | ||||
|         image_path=args.image_path, | ||||
|         models_root=args.models_root, | ||||
|         token_count=args.token_count | ||||
|     ) | ||||
							
								
								
									
										5
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								setup.py
									
									
									
									
									
								
							| @@ -1,11 +1,14 @@ | ||||
| import setuptools | ||||
| from pathlib import Path | ||||
|  | ||||
| setuptools.setup( | ||||
|     name='min-dalle', | ||||
|     description = 'min(DALL·E)', | ||||
|     version='0.2.0', | ||||
|     long_description=(Path(__file__).parent / "README").read_text(), | ||||
|     version='0.2.5', | ||||
|     author='Brett Kuprel', | ||||
|     author_email='brkuprel@gmail.com', | ||||
|     url='https://github.com/kuprel/min-dalle', | ||||
|     packages=[ | ||||
|         'min_dalle',  | ||||
|         'min_dalle.models' | ||||
|   | ||||
		Reference in New Issue
	
	Block a user