Sean Powell commited on
Commit
98271f9
·
1 Parent(s): d0bd7a7

Add func to compute tile width from wallpaper width.

Browse files
Files changed (1) hide show
  1. utils/tiling.py +5 -0
utils/tiling.py CHANGED
@@ -1,3 +1,4 @@
 
1
  from typing import Optional
2
 
3
  import diffusers
@@ -58,3 +59,7 @@ def enable_circular_tiling(targets):
58
  cl.lora_layer = lambda *x: 0
59
 
60
  cl._conv_forward = asymmetric_conv2d_conv_forward.__get__(cl, torch.nn.Conv2d)
 
 
 
 
 
1
+ import math
2
  from typing import Optional
3
 
4
  import diffusers
 
59
  cl.lora_layer = lambda *x: 0
60
 
61
  cl._conv_forward = asymmetric_conv2d_conv_forward.__get__(cl, torch.nn.Conv2d)
62
+
63
+
64
+ def compute_input_tile_width_for_desired_output(desired_output):
65
+ return round((desired_output * 2) // math.sqrt(2))