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

Cannot copy out of meta tensor; no data - Using SDv2.1 #191

Open
Ralph224 opened this issue Feb 17, 2023 · 0 comments
Open

Cannot copy out of meta tensor; no data - Using SDv2.1 #191

Ralph224 opened this issue Feb 17, 2023 · 0 comments

Comments

@Ralph224
Copy link

Hi,

When running SDV2.1, when I upload an image and run a prompt, I get the following error:

C:\Users\miniforge3\envs\sd-inf\lib\site-packages\diffusers\pipelines\stable_diffusion\pipeline_stable_diffusion_inpaint_legacy.py:505: FutureWarning: The init_image argument is deprecated and will be removed in version 0.12.0. Please use image instead of init_image.
init_image = deprecate("init_image", "0.12.0", message, take_from=kwargs)
Traceback (most recent call last):
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\gradio\routes.py", line 337, in run_predict
output = await app.get_blocks().process_api(
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\gradio\blocks.py", line 1015, in process_api
result = await self.call_function(
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\gradio\blocks.py", line 833, in call_function
prediction = await anyio.to_thread.run_sync(
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\anyio_backends_asyncio.py", line 867, in run
result = context.run(func, *args)
File "C:\Users\stablediffusion-infinity-master\app.py", line 868, in run_outpaint
images = cur_model.run(
File "C:\Users\stablediffusion-infinity-master\app.py", line 759, in run
images = inpaint_func(
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\diffusers\pipelines\stable_diffusion\pipeline_stable_diffusion_inpaint_legacy.py", line 538, in call
latents, init_latents_orig, noise = self.prepare_latents(
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\diffusers\pipelines\stable_diffusion\pipeline_stable_diffusion_inpaint_legacy.py", line 408, in prepare_latents
init_latent_dist = self.vae.encode(image).latent_dist
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\diffusers\models\vae.py", line 566, in encode
h = self.encoder(x)
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\diffusers\models\vae.py", line 130, in forward
sample = self.conv_in(sample)
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\accelerate\hooks.py", line 151, in new_forward
args, kwargs = module._hf_hook.pre_forward(module, *args, **kwargs)
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\accelerate\hooks.py", line 266, in pre_forward
return send_to_device(args, self.execution_device), send_to_device(kwargs, self.execution_device)
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\accelerate\utils\operations.py", line 130, in send_to_device
return recursively_apply(_send_to_device, tensor, device, non_blocking, test_type=_has_to_method)
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\accelerate\utils\operations.py", line 79, in recursively_apply
return honor_type(
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\accelerate\utils\operations.py", line 50, in honor_type
return type(obj)(generator)
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\accelerate\utils\operations.py", line 82, in
recursively_apply(
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\accelerate\utils\operations.py", line 98, in recursively_apply
return func(data, *args, **kwargs)
File "C:\Users\miniforge3\envs\sd-inf\lib\site-packages\accelerate\utils\operations.py", line 123, in _send_to_device
return t.to(device, non_blocking=non_blocking)
NotImplementedError: Cannot copy out of meta tensor; no data!

Also worth saying here:
I am only able to upload image and run a prompt with version Stablediffusion-inpainting+img2img-1.5
All other ones are giving me an error about init_image except this version that gives me the meta tensor, no data! but by looking at the code errors here, it looks that resolving the meta tensor will help but will still have the init_image error like I have on the other versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant