MCPcopy
hub / github.com/kohya-ss/sd-scripts / interpolate

Method interpolate

library/utils.py:423–434  ·  view source on GitHub ↗
(self, x: torch.Tensor, resized_size, unsharp=True)

Source from the content-addressed store, hash-verified

421 return sharpened
422
423 def interpolate(self, x: torch.Tensor, resized_size, unsharp=True):
424 org_dtype = x.dtype
425 if org_dtype == torch.bfloat16:
426 x = x.float()
427
428 x = torch.nn.functional.interpolate(x, size=resized_size, mode="bicubic", align_corners=False).to(dtype=org_dtype)
429
430 # apply unsharp mask / アンシャープマスクを適用する
431 if unsharp and self.gaussian_blur_ksize:
432 x = self.apply_unshark_mask(x)
433
434 return x
435
436
437class EulerAncestralDiscreteSchedulerGL(EulerAncestralDiscreteScheduler):

Callers 15

trainFunction · 0.80
trainMethod · 0.80
__call__Method · 0.80
process_batchFunction · 0.80
downsample_maskFunction · 0.80
__call__Method · 0.80
process_batchFunction · 0.80
trainFunction · 0.80
trainFunction · 0.80
__call__Method · 0.80
process_batchFunction · 0.80

Calls 2

apply_unshark_maskMethod · 0.95
toMethod · 0.80

Tested by

no test coverage detected