Skip to content

[Issue]: inpainting with HyperTile Exception: division by zero #3975

Open
@Altaiar

Description

@Altaiar

Issue Description

hi when i try to inpainting i do a very basic masking and click on generate i always get this error message but i could do inpainting with cpu on openvino on another computer (because normally fallback on cpu will not work simply nothing happens when u click on start i should force run on openvino for cpu to work same on i7 4910mq and intel i5 8400 not only inpaiting but image generation wont work on normal startup it just stuck nothing happen no log or errors )

Version Platform Description

Python: version=3.11.4
platform=Windows11
Version: app=sd.next updated=2025-06-03
browser microsoft Edge
ram 16
gpu 4060 8gb

Relevant log output

22:26:22-206208 INFO     Applying hypertile: unet=128/128
22:26:22-207208 ERROR    Exception: division by zero
22:26:22-208212 ERROR    Arguments: args=('task(6e92js75y0g6qhb)', '', 1.0, '', '', [], None, None, {'image':
                         <PIL.Image.Image image mode=RGBA size=1024x1024 at 0x215447ABD10>, 'mask': <PIL.Image.Image
                         image mode=RGB size=1024x1024 at 0x21555D80490>}, None, None, None, None, 20, 0, 4, 1, 1,
                         'Full', False, False, False, '', '', 10, 0.3, 1, 1, 6, 6, 0, 0, 0.5, 1, 0, 1, 0.3, -1.0, -1.0,
                         0, 0, 0, 0, 0, 0, 1, 1, 'None', 'Add with forward', 0, 32, 0, None, '', '', '', 0, 0, 0, 0,
                         False, 4, 0.95, False, 0.6, 1, '#000000', 0, False, 48, 0.3, 1, 'Add with forward', 'None',
                         False, 20, 1, 0, 0, 20, 0, '', '', [], 0, 1, False, 'None', 'None', 'None', 'None', 0.5, 0.5,
                         0.5, 0.5, None, None, None, None, False, False, False, False, 0, 0, 0, 0, 1, 1, 1, 1, None,
                         None, None, None, False, '', '', None, False, 'google/gemma-3-4b-it', '', '', '', 50, True,
                         0.15, 1.2, False, True, False, 0, '', [], 0, '', [], 0, '', [], False, True, False, True,
                         False, False, False, False, 0, False, 'None', 2, True, 1, 0, 'constant', 1, 'constant', 1,
                         '#04F404', 65, 0, 0, 0.15, 0.9, '', '', 0.5, '', 0.5, 5, None, '', 0.5, 5, None, True, 1,
                         False, 'None', None, 'None', [], 'ReSwapper 256 0.2', False, 'FaceID Base', True, True, 1, 1,
                         1, 0.5, True, 'PhotoMaker v2', '', 1, 0.5, True, False, 0.7, 1.2, 128, 'None', 0, True, True,
                         2, True, 1, 35, True, 1, 0.75, True, 2, 0.75, False, 3, 0.75, False, 4, 0.75, 0.65, True,
                         False, 1, 1, 1, 0, 1, False, False, False, None, 0.1, 1, True, '', 0.5, 0.9, '', 0.5, 0.9, 4,
                         0.5, 'Linear', 'None', True, None, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 128, 128, '', '', '', '',
                         '', '', '', '', '', '', '', '', '', '', '', '', 'OpenGVLab/InternVL-14B-224px', '<span>&nbsp
                         Outpainting</span><br>', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left',
                         'right', 'up', 'down'], 20, False, False, 'positive', 'comma', 0, False, False, '', [], 0.8,
                         20, 'dpmpp_sde', 'v2', False, True, 'v1.1', '<span>&nbsp SD Upscale</span><br>', 64, 0, 2,
                         '7,8,9', 1, 0.01, 0.2, True, True, 0.65, None, '', False, ['attention', 'adain_queries',
                         'adain_keys'], 1, 0, 0, 'THUDM/CogVideoX-2b', 'DDIM', 49, 6, 'balanced', True, 'None', 2, True,
                         1, 0, None, None, '0.9.1', '', 'diffusers', True, 41, 'None', 2, True, 1, 0, False, 0.03, 'SVD
                         1.0', 14, True, 1, 3, 6, 0.5, 0.1, 'None', 2, True, 1, 0, 'None', 16, 'None', 2, True, 1, 0,
                         'none', 3, 4, 0.25, 0.25, 0.5, 0.5, 0, '', [], 0, '', [], 0, '', [], False, True, False, True,
                         False, False, False, False, 0, False, 'None', 2, True, 1, 0) kwargs={}
22:26:22-230211 ERROR    gradio call: ZeroDivisionError
╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│ H:\GIT\automatic\modules\call_queue.py:31 in f                                                                       │
│                                                                                                                      │
│   30 │   │   │   try:                                                                                                │
│ ❱ 31 │   │   │   │   res = func(*args, **kwargs)                                                                     │
│   32 │   │   │   │   progress.record_results(id_task, res)                                                           │
│                                                                                                                      │
│ H:\GIT\automatic\modules\img2img.py:308 in img2img                                                                   │
│                                                                                                                      │
│   307 │   │   if processed is None:                                                                                  │
│ ❱ 308 │   │   │   processed = processing.process_images(p)                                                           │
│   309 │   │   processed = modules.scripts.scripts_img2img.after(p, processed, *args)                                 │
│                                                                                                                      │
│ H:\GIT\automatic\modules\processing.py:215 in process_images                                                         │
│                                                                                                                      │
│   214 │   │   else:                                                                                                  │
│ ❱ 215 │   │   │   with context_hypertile_vae(p), context_hypertile_unet(p):                                          │
│   216 │   │   │   │   processed = process_images_inner(p)                                                            │
│                                                                                                                      │
│ C:\Python311\Lib\contextlib.py:137 in __enter__                                                                      │
│                                                                                                                      │
│   136 │   │   try:                                                                                                   │
│ ❱ 137 │   │   │   return next(self.gen)                                                                              │
│   138 │   │   except StopIteration:                                                                                  │
│                                                                                                                      │
│ H:\GIT\automatic\modules\sd_hijack_hypertile.py:83 in split_attention                                                │
│                                                                                                                      │
│    82 │   global reset_needed # pylint: disable=global-statement                                                     │
│ ❱  83 │   ar = height / width # Aspect ratio                                                                         │
│    84 │   reset_needed = True                                                                                        │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ZeroDivisionError: division by zero

Backend

Diffusers

Compute

nVidia CUDA

UI

Standard

Branch

Master

Model

StableDiffusion 2.1

Acknowledgements

  • I have read the above and searched for existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions