mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-30 16:20:17 +08:00
Fix issues with missing __init__ in upscaler, move web/ directory to comfy/web so that the need for symbolic link support on windows is eliminated
This commit is contained in:
parent
d31298ac60
commit
345825dfb5
2
.gitignore
vendored
2
.gitignore
vendored
@ -35,8 +35,6 @@ dist/
|
|||||||
downloads/
|
downloads/
|
||||||
eggs/
|
eggs/
|
||||||
.eggs/
|
.eggs/
|
||||||
lib/
|
|
||||||
lib64/
|
|
||||||
parts/
|
parts/
|
||||||
sdist/
|
sdist/
|
||||||
var/
|
var/
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
recursive-include web *
|
recursive-include comfy/web *
|
||||||
|
|||||||
@ -105,7 +105,7 @@ class PromptServer():
|
|||||||
self.app = web.Application(client_max_size=max_upload_size, handler_args={'max_field_size': 16380},
|
self.app = web.Application(client_max_size=max_upload_size, handler_args={'max_field_size': 16380},
|
||||||
middlewares=middlewares)
|
middlewares=middlewares)
|
||||||
self.sockets = dict()
|
self.sockets = dict()
|
||||||
web_root_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../web")
|
web_root_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../web")
|
||||||
if not os.path.exists(web_root_path):
|
if not os.path.exists(web_root_path):
|
||||||
web_root_path = resource_filename('comfy', 'web/')
|
web_root_path = resource_filename('comfy', 'web/')
|
||||||
self.web_root = web_root_path
|
self.web_root = web_root_path
|
||||||
|
|||||||
@ -10,6 +10,7 @@ class UpscaleModelLoader:
|
|||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
return {"required": {"model_name": (folder_paths.get_filename_list("upscale_models"),),
|
return {"required": {"model_name": (folder_paths.get_filename_list("upscale_models"),),
|
||||||
}}
|
}}
|
||||||
|
|
||||||
RETURN_TYPES = ("UPSCALE_MODEL",)
|
RETURN_TYPES = ("UPSCALE_MODEL",)
|
||||||
FUNCTION = "load_model"
|
FUNCTION = "load_model"
|
||||||
|
|
||||||
@ -30,6 +31,7 @@ class ImageUpscaleWithModel:
|
|||||||
return {"required": {"upscale_model": ("UPSCALE_MODEL",),
|
return {"required": {"upscale_model": ("UPSCALE_MODEL",),
|
||||||
"image": ("IMAGE",),
|
"image": ("IMAGE",),
|
||||||
}}
|
}}
|
||||||
|
|
||||||
RETURN_TYPES = ("IMAGE",)
|
RETURN_TYPES = ("IMAGE",)
|
||||||
FUNCTION = "upscale"
|
FUNCTION = "upscale"
|
||||||
|
|
||||||
@ -47,9 +49,11 @@ class ImageUpscaleWithModel:
|
|||||||
oom = True
|
oom = True
|
||||||
while oom:
|
while oom:
|
||||||
try:
|
try:
|
||||||
steps = in_img.shape[0] * utils.get_tiled_scale_steps(in_img.shape[3], in_img.shape[2], tile_x=tile, tile_y=tile, overlap=overlap)
|
steps = in_img.shape[0] * utils.get_tiled_scale_steps(in_img.shape[3], in_img.shape[2], tile_x=tile,
|
||||||
|
tile_y=tile, overlap=overlap)
|
||||||
pbar = utils.ProgressBar(steps)
|
pbar = utils.ProgressBar(steps)
|
||||||
s = utils.tiled_scale(in_img, lambda a: upscale_model(a), tile_x=tile, tile_y=tile, overlap=overlap, upscale_amount=upscale_model.scale, pbar=pbar)
|
s = utils.tiled_scale(in_img, lambda a: upscale_model(a), tile_x=tile, tile_y=tile, overlap=overlap,
|
||||||
|
upscale_amount=upscale_model.scale, pbar=pbar)
|
||||||
oom = False
|
oom = False
|
||||||
except model_management.OOM_EXCEPTION as e:
|
except model_management.OOM_EXCEPTION as e:
|
||||||
tile //= 2
|
tile //= 2
|
||||||
@ -60,6 +64,7 @@ class ImageUpscaleWithModel:
|
|||||||
s = torch.clamp(s.movedim(-3, -1), min=0, max=1.0)
|
s = torch.clamp(s.movedim(-3, -1), min=0, max=1.0)
|
||||||
return (s,)
|
return (s,)
|
||||||
|
|
||||||
|
|
||||||
NODE_CLASS_MAPPINGS = {
|
NODE_CLASS_MAPPINGS = {
|
||||||
"UpscaleModelLoader": UpscaleModelLoader,
|
"UpscaleModelLoader": UpscaleModelLoader,
|
||||||
"ImageUpscaleWithModel": ImageUpscaleWithModel
|
"ImageUpscaleWithModel": ImageUpscaleWithModel
|
||||||
|
|||||||
2
setup.py
2
setup.py
@ -150,7 +150,7 @@ def dependencies() -> List[str]:
|
|||||||
|
|
||||||
package_data = ['sd1_tokenizer/*', '**/*.json', '**/*.yaml']
|
package_data = ['sd1_tokenizer/*', '**/*.json', '**/*.yaml']
|
||||||
if not is_editable:
|
if not is_editable:
|
||||||
package_data.append('web/**/*')
|
package_data.append('comfy/web/**/*')
|
||||||
setup(
|
setup(
|
||||||
name=package_name,
|
name=package_name,
|
||||||
description="",
|
description="",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user