Closed edisonzf2020 closed 9 months ago
Please try this,
from segmoe import SegMoEPipeline
pipeline = SegMoEPipeline("segmind/SegMoE-sd-4x2-v0", device = "cuda", safety_checker = None)
prompt = "a beautiful Asian girl, front view, full-length portrait, One hand is half-raised, as if waving hello."
negative_prompt = "ugly, deformed, badhandv4, ng_deepnegative_v1_75t, nsfw, bad quality, worse quality"
img = pipeline(
prompt=prompt,
negative_prompt=negative_prompt,
height=768,
width=512,
num_inference_steps=30,
guidance_scale=7.5,
seed=1575769330,
Sampler='DPM++ SDE Karras',
low_cpu_mem_usage=True,
).images[0]
img.save("image1.png")
HI, I tried this yesterday and double checked just now and it doesn't work. The SegMoEPipeline doesn't pass the kwargs into the DiffusionPipeline
Hello, could you please elaborate on the issue? Any stacktraces would help, as would further details of where the kwargs are missed.
https://github.com/segmind/segmoe/blob/main/segmoe/main.py
line 126, the call to DiffusionPipeline.from_pretrained doesn't pass the kwargs left after you've popped some off to use as class variables (fields whatever they are called in python)
self.pipe = DiffusionPipeline.from_pretrained(
cached_folder,
unet=unet,
torch_dtype=self.torch_dtype,
use_safetensors=self.use_safetensors,
)
could be
self.pipe = DiffusionPipeline.from_pretrained(
cached_folder,
unet=unet,
torch_dtype=self.torch_dtype,
use_safetensors=self.use_safetensors,
**kwargs
)
Code typed edited in here, it needs testing, I don't think I've tried passing **kwargs after all the variables have been popped before.
Fixed with PR #14, Thanks for raising the issue!
I use the following code to test
An error will occur if you repeat the execution 2-3 times. The error message is as follows:
Potential NSFW content was detected in one or more images. A black image will be returned instead. Try again with a different prompt and/or seed.