fix texture tiling

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-04-30 09:44:34 -04:00
parent 473f394f97
commit a84b77d396
3 changed files with 6 additions and 6 deletions
+2
View File
@@ -12,11 +12,13 @@
- CUDA: set default to `torch==2.7.0` with `cuda==12.8`
- FramePack: improve performance
- Docker: pre-install `ffmpeg`
- Wiki: updated pages: *Video, ZLUDA*
- **Fixes**
- FramePack: correct dtype
- NNCF: check dependencies and register quant type
- API: refresh checkpoint list
- Styles: save style with prompt
- Texture tiling: fix apply when switching models
## Highlights for 2025-04-28
+3 -5
View File
@@ -538,19 +538,17 @@ def set_latents(p):
return latents
last_circular = False
def apply_circular(enable, model):
global last_circular # pylint: disable=global-statement
def apply_circular(enable: bool, model):
if not hasattr(model, 'unet') or not hasattr(model, 'vae'):
return
if last_circular == enable:
if getattr(model, 'texture_tiling', False) == enable:
return
try:
for layer in [layer for layer in model.unet.modules() if type(layer) is torch.nn.Conv2d]:
layer.padding_mode = 'circular' if enable else 'zeros'
for layer in [layer for layer in model.vae.modules() if type(layer) is torch.nn.Conv2d]:
layer.padding_mode = 'circular' if enable else 'zeros'
last_circular = enable
model.texture_tiling = enable
except Exception as e:
debug(f"Diffusers tiling failed: {e}")
+1 -1
Submodule wiki updated: 520ecec454...2c058a6614