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

Any chance class members like self._interrupt could be defined in __init__ across pipelines? #11002

Open
spezialspezial opened this issue Mar 7, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@spezialspezial
Copy link
Contributor

spezialspezial commented Mar 7, 2025

Describe the bug

I think there is no benefit to late initializing here and it puts a burden on the library user that could be easily avoided. Also leads to some confusion as it is uncommon, code inspection flags this. Let me know if I'm missing something.

Reproduction

class WanImageToVideoPipeline:
	def __init__(self):
		pass
	
	def __call__(self, *args, **kwargs):
		self._interrupt = False
		return 23

	@property
	def interrupt(self):
		return self._interrupt
	
pipe = WanImageToVideoPipeline()

def on_async_user_abort_call_me_any_time():
	# check if already interrupted but mid step
	print(pipe.interrupt)


on_async_user_abort_call_me_any_time()

Logs

AttributeError: 'WanImageToVideoPipeline' object has no attribute '_interrupt'. Did you mean: 'interrupt'?

System Info

Diffusers 0.33.0.dev0, Linux, Python 3.10

Who can help?

@yiyixuxu @DN6

@spezialspezial spezialspezial added the bug Something isn't working label Mar 7, 2025
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

1 participant