mirror of https://github.com/skygpu/skynet.git
				
				
				
			Fix minor errors, update lockfile, add cli entrypoints in pyproject.toml fix README
							parent
							
								
									18ca8c573a
								
							
						
					
					
						commit
						1e40c05da6
					
				| 
						 | 
					@ -29,9 +29,6 @@ poetry shell
 | 
				
			||||||
# test you can run this command
 | 
					# test you can run this command
 | 
				
			||||||
skynet --help
 | 
					skynet --help
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# launch ipfs node
 | 
					 | 
				
			||||||
skynet run ipfs
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# to launch worker
 | 
					# to launch worker
 | 
				
			||||||
skynet run dgpu
 | 
					skynet run dgpu
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -77,9 +74,6 @@ docker pull guilledk/skynet:runtime-cuda
 | 
				
			||||||
# or build it (takes a bit of time)
 | 
					# or build it (takes a bit of time)
 | 
				
			||||||
./build_docker.sh
 | 
					./build_docker.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# launch simple ipfs node
 | 
					 | 
				
			||||||
./launch_ipfs.sh
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# run worker with all gpus
 | 
					# run worker with all gpus
 | 
				
			||||||
docker run \
 | 
					docker run \
 | 
				
			||||||
    -it \
 | 
					    -it \
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,12 +1,3 @@
 | 
				
			||||||
 | 
					 | 
				
			||||||
docker build \
 | 
					 | 
				
			||||||
    -t guilledk/skynet:runtime \
 | 
					 | 
				
			||||||
    -f docker/Dockerfile.runtime .
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
docker build \
 | 
					 | 
				
			||||||
    -t guilledk/skynet:runtime-frontend \
 | 
					 | 
				
			||||||
    -f docker/Dockerfile.runtime+frontend .
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
docker build \
 | 
					docker build \
 | 
				
			||||||
    -t guilledk/skynet:runtime-cuda-py311 \
 | 
					    -t guilledk/skynet:runtime-cuda-py311 \
 | 
				
			||||||
    -f docker/Dockerfile.runtime+cuda-py311 .
 | 
					    -f docker/Dockerfile.runtime+cuda-py311 .
 | 
				
			||||||
| 
						 | 
					@ -14,7 +5,3 @@ docker build \
 | 
				
			||||||
docker build \
 | 
					docker build \
 | 
				
			||||||
    -t guilledk/skynet:runtime-cuda \
 | 
					    -t guilledk/skynet:runtime-cuda \
 | 
				
			||||||
    -f docker/Dockerfile.runtime+cuda-py311 .
 | 
					    -f docker/Dockerfile.runtime+cuda-py311 .
 | 
				
			||||||
 | 
					 | 
				
			||||||
docker build \
 | 
					 | 
				
			||||||
    -t guilledk/skynet:runtime-cuda-py310 \
 | 
					 | 
				
			||||||
    -f docker/Dockerfile.runtime+cuda-py310 .
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| 
						 | 
					@ -65,3 +65,7 @@ build-backend = 'poetry.core.masonry.api'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[tool.poetry.scripts]
 | 
					[tool.poetry.scripts]
 | 
				
			||||||
skynet = 'skynet.cli:skynet'
 | 
					skynet = 'skynet.cli:skynet'
 | 
				
			||||||
 | 
					txt2img = 'skynet.cli:txt2img'
 | 
				
			||||||
 | 
					img2img = 'skynet.cli:img2img'
 | 
				
			||||||
 | 
					upscale = 'skynet.cli:upscale'
 | 
				
			||||||
 | 
					inpaint = 'skynet.cli:inpaint'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,7 @@ MODELS = {
 | 
				
			||||||
    'nousr/robo-diffusion':                             {'short': 'robot',               'mem': 6,   'size': {'w': 512,  'h': 512}},
 | 
					    'nousr/robo-diffusion':                             {'short': 'robot',               'mem': 6,   'size': {'w': 512,  'h': 512}},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # -1 is always inpaint default
 | 
					    # -1 is always inpaint default
 | 
				
			||||||
    'diffusers/stable-diffusion-xl-1.0-inpainting-0.1': {'short': 'stablexl-inpainting': 'mem': 8.3, 'size': {'w': 1024, 'h': 1024}},
 | 
					    'diffusers/stable-diffusion-xl-1.0-inpainting-0.1': {'short': 'stablexl-inpainting', 'mem': 8.3, 'size': {'w': 1024, 'h': 1024}},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # default is always last
 | 
					    # default is always last
 | 
				
			||||||
    'stabilityai/stable-diffusion-xl-base-1.0':         {'short': 'stablexl',            'mem': 8.3, 'size': {'w': 1024, 'h': 1024}},
 | 
					    'stabilityai/stable-diffusion-xl-base-1.0':         {'short': 'stablexl',            'mem': 8.3, 'size': {'w': 1024, 'h': 1024}},
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,6 +18,7 @@ from PIL import Image
 | 
				
			||||||
from basicsr.archs.rrdbnet_arch import RRDBNet
 | 
					from basicsr.archs.rrdbnet_arch import RRDBNet
 | 
				
			||||||
from diffusers import (
 | 
					from diffusers import (
 | 
				
			||||||
    DiffusionPipeline,
 | 
					    DiffusionPipeline,
 | 
				
			||||||
 | 
					    AutoPipelineForInpainting,
 | 
				
			||||||
    EulerAncestralDiscreteScheduler
 | 
					    EulerAncestralDiscreteScheduler
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
from realesrgan import RealESRGANer
 | 
					from realesrgan import RealESRGANer
 | 
				
			||||||
| 
						 | 
					@ -58,6 +59,9 @@ def crop_image(image: Image, max_w: int, max_h: int) -> Image:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return image.convert('RGB')
 | 
					    return image.convert('RGB')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def convert_from_bytes_and_crop(raw: bytes, max_w: int, max_h: int) -> Image:
 | 
				
			||||||
 | 
					    return crop_image(convert_from_bytes_to_img(raw), max_w, max_h)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def pipeline_for(
 | 
					def pipeline_for(
 | 
				
			||||||
    model: str,
 | 
					    model: str,
 | 
				
			||||||
| 
						 | 
					@ -205,7 +209,7 @@ def inpaint(
 | 
				
			||||||
    seed: Optional[int] = None
 | 
					    seed: Optional[int] = None
 | 
				
			||||||
):
 | 
					):
 | 
				
			||||||
    login(token=hf_token)
 | 
					    login(token=hf_token)
 | 
				
			||||||
    pipe = pipeline_for(model, image=True)
 | 
					    pipe = pipeline_for(model, image=True, inpainting=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    model_info = MODELS[model]
 | 
					    model_info = MODELS[model]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -220,7 +224,7 @@ def inpaint(
 | 
				
			||||||
    image = pipe(
 | 
					    image = pipe(
 | 
				
			||||||
        prompt,
 | 
					        prompt,
 | 
				
			||||||
        image=input_img,
 | 
					        image=input_img,
 | 
				
			||||||
        mask_image=mask_img
 | 
					        mask_image=mask_img,
 | 
				
			||||||
        strength=strength,
 | 
					        strength=strength,
 | 
				
			||||||
        guidance_scale=guidance, num_inference_steps=steps,
 | 
					        guidance_scale=guidance, num_inference_steps=steps,
 | 
				
			||||||
        generator=torch.Generator("cuda").manual_seed(seed)
 | 
					        generator=torch.Generator("cuda").manual_seed(seed)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue