mirror of
https://github.com/jags111/efficiency-nodes-comfyui.git
synced 2026-03-21 21:22:13 -03:00
Update city96_latent_upscaler.py
added a line on noise mask
This commit is contained in:
committed by
GitHub
parent
f3e6e6d506
commit
12c31e8967
@@ -1,4 +1,5 @@
|
|||||||
# https://github.com/city96/SD-Latent-Upscaler
|
# https://github.com/city96/SD-Latent-Upscaler
|
||||||
|
# check if any issues on weights and updates and local install for same
|
||||||
import torch
|
import torch
|
||||||
import torch.nn as nn
|
import torch.nn as nn
|
||||||
from safetensors.torch import load_file
|
from safetensors.torch import load_file
|
||||||
@@ -79,4 +80,9 @@ class LatentUpscaler:
|
|||||||
lt = samples["samples"]
|
lt = samples["samples"]
|
||||||
lt = model(lt)
|
lt = model(lt)
|
||||||
del model
|
del model
|
||||||
return ({"samples": lt},)
|
if "noise_mask" in samples.keys():
|
||||||
|
# expand the noise mask to the same shape as the latent
|
||||||
|
mask = torch.nn.functional.interpolate(samples['noise_mask'], scale_factor=float(scale_factor), mode='bicubic')
|
||||||
|
return ({"samples": lt, "noise_mask": mask},)
|
||||||
|
return ({"samples": lt},)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user