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

AttributeError: 'NoneType' object has no attribute 'sample_img2img' #182

Open
yasainet opened this issue Dec 7, 2023 · 8 comments
Open

Comments

@yasainet
Copy link

yasainet commented Dec 7, 2023

*** Error running postprocess: C:\Users\dev\stable-diffusion-webui\extensions\sd-face-editor\scripts\face_editor_extension.py
    Traceback (most recent call last):
      File "C:\Users\dev\stable-diffusion-webui\modules\scripts.py", line 750, in postprocess
        script.postprocess(p, processed, *script_args)
      File "C:\Users\dev\stable-diffusion-webui\extensions\sd-face-editor\scripts\face_editor_extension.py", line 53, in postprocess
        ImageProcessor(WorkflowManager.get(option.workflow)).proc_images(o, res, option)
      File "C:\Users\dev\stable-diffusion-webui\extensions\sd-face-editor\scripts\use_cases\image_processor.py", line 62, in proc_images
        proc = self.proc_image(p, option, image, res.infotexts[i], (res.width, res.height))
      File "C:\Users\dev\stable-diffusion-webui\extensions\sd-face-editor\scripts\use_cases\image_processor.py", line 176, in proc_image
        proc_image = self.workflow.process(jobs, face, p, option)
      File "C:\Users\dev\stable-diffusion-webui\extensions\sd-face-editor\scripts\use_cases\workflow_manager.py", line 162, in process
        image = face_processor.process(face, p, **params)
      File "C:\Users\dev\stable-diffusion-webui\extensions\sd-face-editor\scripts\inferencers\img2img_face_processor.py", line 55, in process
        proc = process_images(p)
      File "C:\Users\dev\stable-diffusion-webui\modules\processing.py", line 734, in process_images
        res = process_images_inner(p)
      File "C:\Users\dev\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 42, in processing_process_images_hijack
        return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
      File "C:\Users\dev\stable-diffusion-webui\modules\processing.py", line 868, in process_images_inner
        samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
      File "C:\Users\dev\stable-diffusion-webui\modules\processing.py", line 1527, in sample
        samples = self.sampler.sample_img2img(self, self.init_latent, x, conditioning, unconditional_conditioning, image_conditioning=self.image_conditioning)
    AttributeError: 'NoneType' object has no attribute 'sample_img2img'

いままで Adetailer を利用していましたが、この拡張機能を試してみました。
インストールして、「enable」だけにチェック入れた状態で t2i を実行したらこのエラーが出ました。

解決方法を教えて下さい。

@yasainet
Copy link
Author

yasainet commented Dec 7, 2023

I have been using Adetailer and tried this extension. I installed it and ran t2i with only "enable" checked and got this error.

Please let me know how to solve this problem.

@ototadana
Copy link
Owner

ototadana commented Dec 7, 2023

I have never seen this error before.

From the traceback message, it seems that sampler is set to None, but I have no idea as to the cause of this. Did you see any messages in the console before this error?

@yasainet
Copy link
Author

yasainet commented Dec 7, 2023

No, nothing in particular seems to appear before or after!

prompt for the face: 1 girl, (8k, RAW photo, masterpiece, ultra-detailed, realistic photo, best quality, ultra high res), (huge breasts:1.5), micro bikini, sitting, short hair
*** Error running postprocess: C:\Users\dev\stable-diffusion-webui\extensions\sd-face-editor\scripts\face_editor_extension.py
    Traceback (most recent call last):
      File "C:\Users\dev\stable-diffusion-webui\modules\scripts.py", line 750, in postprocess
        script.postprocess(p, processed, *script_args)
      File "C:\Users\dev\stable-diffusion-webui\extensions\sd-face-editor\scripts\face_editor_extension.py", line 53, in postprocess
        ImageProcessor(WorkflowManager.get(option.workflow)).proc_images(o, res, option)
      File "C:\Users\dev\stable-diffusion-webui\extensions\sd-face-editor\scripts\use_cases\image_processor.py", line 62, in proc_images
        proc = self.proc_image(p, option, image, res.infotexts[i], (res.width, res.height))
      File "C:\Users\dev\stable-diffusion-webui\extensions\sd-face-editor\scripts\use_cases\image_processor.py", line 176, in proc_image
        proc_image = self.workflow.process(jobs, face, p, option)
      File "C:\Users\dev\stable-diffusion-webui\extensions\sd-face-editor\scripts\use_cases\workflow_manager.py", line 162, in process
        image = face_processor.process(face, p, **params)
      File "C:\Users\dev\stable-diffusion-webui\extensions\sd-face-editor\scripts\inferencers\img2img_face_processor.py", line 55, in process
        proc = process_images(p)
      File "C:\Users\dev\stable-diffusion-webui\modules\processing.py", line 734, in process_images
        res = process_images_inner(p)
      File "C:\Users\dev\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 42, in processing_process_images_hijack
        return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
      File "C:\Users\dev\stable-diffusion-webui\modules\processing.py", line 868, in process_images_inner
        samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
      File "C:\Users\dev\stable-diffusion-webui\modules\processing.py", line 1527, in sample
        samples = self.sampler.sample_img2img(self, self.init_latent, x, conditioning, unconditional_conditioning, image_conditioning=self.image_conditioning)
    AttributeError: 'NoneType' object has no attribute 'sample_img2img'

---
Total progress: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 40/40 [00:01<00:00, 22.78it/s]
Total progress: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 40/40 [00:01<00:00, 25.36it/s] 

I don't know if this will help, but I wrote down all the information: 🙇‍♂️

1 girl, (8k, RAW photo, masterpiece, ultra-detailed, realistic photo, best quality, ultra high res), (huge breasts:1.5), micro bikini, sitting, short hair
Negative prompt: (worst quality:2), (low quality:2), (normal quality:2), (monochrome), (grayscale), tatoo, text, signature, stamps, watermark, blurry
Steps: 40, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: 1977164875, Size: 512x768, Model hash: 7c819b6d13, Model: majicmixRealistic_v7, Clip skip: 2, Unprompted Enabled: True, Unprompted Prompt: "1 girl, (8k, RAW photo, masterpiece, ultra-detailed, realistic photo, best quality, ultra high res), (huge breasts:1.5), micro bikini, sitting, short hair", Unprompted Negative Prompt: "(worst quality:2), (low quality:2), (normal quality:2), (monochrome), (grayscale), tatoo, text, signature, stamps, watermark, blurry", Unprompted Seed: 1977164875, Version: v1.7.0-RC

a1111 ngrok app____theme=dark

@ototadana
Copy link
Owner

I tried to add the same extensions as yours as much as possible and tried to run them with as much of the same settings as possible, but I could not reproduce the error... 🤔

@yasainet
Copy link
Author

yasainet commented Dec 7, 2023

Thank you for taking the time to verify this!

I will do some more verification on my end.

I will report back to you if I find anything else.

@Alexandeeeeeer
Copy link

Not sure if its still relevant but this happens for me too

@Painter59
Copy link

me too.

@Painter59
Copy link

After much trial and error I narrowed the conflict down to this extension: https://github.com/ThereforeGames/unprompted
It has an option for face improvement as well. I doubt that is the issue because it was not active. However, it was the only option i had 'unprompted' installed for and sd-face-editor works sooooo much better that I simply uninstalled 'unprompted'. Others may be using unprompted for different reasons so it is still a conflict.

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

4 participants