ototadana / sd-face-editor

Face Editor for Stable Diffusion
MIT License
992 stars 81 forks source link

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

Open yasainet opened 7 months ago

yasainet commented 7 months ago
*** 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 commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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 commented 2 months ago

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