Closed Igglepud closed 2 years ago
Stop generating porn.
Stop generating porn.
Ha! If only that was the issue. My last prompt was "potato in a hammock." Before that I tried "kitten butler" and "blatant patriotism". I should also note that this is using dream. If I use txt2img it works about 50%.
Looking for same answer
Safety checker maybe?
Safety checker maybe?
That's my problem. My txt2img.py doesn't look like that. If I ctrl+f, the word "safety" isn't in it.
Just wasted another four hours rendering black boxes. So frustrating.
Well did you pull main
branch to get latest commits?
Well did you pull
main
branch to get latest commits?
I used this guide: https://github.com/joelparkerhenderson/stable-diffusion-macos-install-help
Just saw it doesn't come from CompVis, it comes from here:
OK, cloned the main from here and the files look like they are supposed to. Thanks! I'll run that when I get home. Need to move a bunch of things around now.
There is a line here that does it, didn't try to update it in original repo here, but should work in theory. Or use that colab, no filter there.
def dummy(images, **kwargs): return images, False pipe.safety_checker = dummy
Well did you pull
main
branch to get latest commits?
So with the main branch, I'm getting this:
from imwatermark import WatermarkEncoder
ModuleNotFoundError: No module named 'imwatermark'
I just ran a conda install and a pip install watermark and am getting the same thing.
https://github.com/JustinGuese/stable-diffusor-docker-text2image/blob/master/txt2img.py
On another thread, someone posted fixed txt2img.py
https://github.com/JustinGuese/stable-diffusor-docker-text2image/blob/master/txt2img.py
On another thread, someone posted fixed txt2img.py
What's this do? Fix the import issue?
removes safety filter
removes safety filter
Thanks! I solved that, but now I'm stuck with the watermark.
Update me if you get watermark solved :)
Update me if you get watermark solved :)
I ran pip install imWatermark and changed line 8 to this:
from imWatermark import watermark
Now I'm getting one about no diffusers module.
And now it says my model file doesn't exist...
OK, running! We'll see if I get any images.
"Torch not compiled with CUDA enabled"...
Running again, this time with CUDA. Didn't know I even had a GPU in this thing.
Except it still says I don't have CUDA installed. WTF? I just ran the command from here:
Tediously going through .py files as they crash and changing all "cuda" references to "cpu"
Update me if you get watermark solved :)
I deleted the watermark. Maybe that's naughty, but now it runs. Getting weird memory errors, but I can fix that (I think). Going to close this since my original issue is resolved.
What prompt did you guys put for NSFW? I couldn't get anything dirty even after removing safety check.
What prompt did you guys put for NSFW? I couldn't get anything dirty even after removing safety check.
You are not supposed to use this model for NSFW. As said before:
Stop generating porn.
Everyone has freedom to do what they want to.
What prompt did you guys put for NSFW? I couldn't get anything dirty even after removing safety check.
"little girl"
"little girl"
Umm, I'd rather write something else.
seems to have trouble drawing a duck's duckbill correctly without triggering the nfsw, almost all prompt i try ends with lots of nsfw triggerers
After instantiating the pipeline, just before feeding the prompts, do this
def disabled_safety_checker(images, clip_input):
if len(images.shape) == 4:
num_images = images.shape[0]
return images, [False]*num_images
else:
return images, False
pipeline.safety_checker = disabled_safety_checker
This will turn off the NSFW checker. Make sure to disable this after doing all the configurations of the pipeline. Else it might throw errors. example:
# instantiate and configure the pipeline
model_id = "CompVis/stable-diffusion-v1-4"
pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to("cuda")
pipe.enable_attention_slicing() # saves GPU memory
pipe.enable_xformers_memory_efficient_attention() # speeds inferencing
# disables safety checks
def disabled_safety_checker(images, clip_input):
if len(images.shape)==4:
num_images = images.shape[0]
return images, [False]*num_images
else:
return images, False
pipe.safety_checker = disabled_safety_checker
# generate and save images
pipe_res = pipe("An astronaut riding a horse on a desert", num_inference_steps=50, guidance_scale=7.5)
image = pipe_res.images[0]
image.save(f"results/astronaut.jpg")
I tried looking for NSFW and the word "safety" in both dream.py and text2img.py, but nothing is there to change. Everything I make comes back as a black image. I assume it's the green box issue, but I can't disable the safety checks to tell. How do you turn this off so I can see my outputs?