Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception: Uninitialized input image #822

Open
gerroon opened this issue Sep 2, 2024 · 3 comments
Open

Exception: Uninitialized input image #822

gerroon opened this issue Sep 2, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@gerroon
Copy link

gerroon commented Sep 2, 2024

Description

image

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\dream_textures\generator_process\future.py", line 105, in run_callbacks
    done_callback(self)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\dream_textures\diffusers_backend.py", line 244, in on_done
    callback(future.result(last_only=True))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\dream_textures\generator_process\future.py", line 46, in result
    raise self._exception
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\dream_textures\generator_process\future.py", line 92, in run_callbacks
    exception_callback(self, exception)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\dream_textures\diffusers_backend.py", line 246, in on_exception
    callback(exception)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\dream_textures\operators\project.py", line 388, in callback
    raise results
Exception: Uninitialized input image

Steps to Reproduce

Add a model
In the viewport camera mode
N panel Dream
Project dream texture in edit mode

Expected Behavior

It should project the generated texture?

Addon Version

Windows (CUDA)

Blender Version

Blender 4.1+

GPU

NVIDIA

@gerroon gerroon added the bug Something isn't working label Sep 2, 2024
@carson-katri
Copy link
Owner

Can you share the part of the error that appears before:

The above exception was the direct cause of the following exception:

@gerroon
Copy link
Author

gerroon commented Sep 4, 2024

Hi,

Thanks for looking into it

Loading pipeline components...: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:03<00:00,  1.99it/s]
An ImageBuf was destroyed with a pending error message that was never
retrieved via ImageBuf::geterror(). This was the error message:
Could not initialize ImageBuf: the provided ImageSpec needs a valid width, height, depth, nchannels, format.
Cannot set_pixels() on an uninitialized ImageBuf
Exception: Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\dream_textures\generator_process\actor.py", line 211, in _receive
    for res in iter(response):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\dream_textures\generator_process\actions\depth_to_image.py", line 351, in depth_to_image
    depth = image_to_np(depth, mode="L", size=rounded_size, to_color_space=None)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\dream_textures\image_utils.py", line 867, in image_to_np
    array = resize(array, size)
            ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\dream_textures\image_utils.py", line 520, in resize
    raise Exception(image_out.geterror())
Exception: Uninitialized input image


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\dream_textures\generator_process\future.py", line 92, in run_callbacks
    exception_callback(self, exception)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\dream_textures\diffusers_backend.py", line 246, in on_exception
    callback(exception)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\dream_textures\operators\project.py", line 388, in callback
    raise results
Exception: Uninitialized input image
Exception: Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\dream_textures\generator_process\actor.py", line 211, in _receive
    for res in iter(response):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\dream_textures\generator_process\actions\depth_to_image.py", line 351, in depth_to_image
    depth = image_to_np(depth, mode="L", size=rounded_size, to_color_space=None)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\dream_textures\image_utils.py", line 867, in image_to_np
    array = resize(array, size)
            ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\dream_textures\image_utils.py", line 520, in resize
    raise Exception(image_out.geterror())
Exception: Uninitialized input image

Can you share the part of the error that appears before:

The above exception was the direct cause of the following exception:

@NullSenseStudio
Copy link
Collaborator

NullSenseStudio commented Oct 9, 2024

As far as I can tell this part of the error is for the image_in variable of the resize function.

An ImageBuf was destroyed with a pending error message that was never
retrieved via ImageBuf::geterror(). This was the error message:
Could not initialize ImageBuf: the provided ImageSpec needs a valid width, height, depth, nchannels, format.
Cannot set_pixels() on an uninitialized ImageBuf

The only way I can replicate this is by creating an ImageBuf with at least one of the dimensions or channels set to 0, though I can't figure out how to cause that through texture projecting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants