lllyasviel / ControlNet

Let us control diffusion models!
Apache License 2.0
30.67k stars 2.75k forks source link

Didn't throw error,but can't generate picture #629

Open huangkaipeng4399 opened 10 months ago

huangkaipeng4399 commented 10 months ago

图片1 Hello, I want to ask why it always takes endless time to process while generating a picture.

My GPU is two NVIDIA GeForce RTX 3090.

Best wishes!

huangkaipeng4399 commented 10 months ago

P.S. Never workout regardless of how much time it takes

tobbler commented 10 months ago

Hello!Have you addressed it?I‘m confused by this problem too.

GauravGajbhiye commented 10 months ago

@huangkaipeng4399, @tobbler Have you resolved this issue?? I am also getting same issue while working on ControlNet.

huangkaipeng4399 commented 9 months ago

@GauravGajbhiye @tobbler Not yet. How about you?

crazy-zxx commented 9 months ago

这个问题是gradio导致的,我解决了这个问题,以及后续的opencv处理图像的一些问题。 The problem was caused by gradio, which I solved, as well as some subsequent issues with opencv processing images.

需要安装以下版本的包: The following version of the package needs to be installed:

pip install xformers==0.0.13 triton==2.2.0 gradio==3.50.2 opencv-python==4.5.2.52

huangkaipeng4399 commented 8 months ago

@crazy-zxx 谢谢!已经解决了

cjsal95 commented 5 months ago

hello! I have the same problem.

I think it's caused by Gradio. Even when I press the run button, the process() function does not execute.

I modified the code as follows to use OpenCV instead of Gradio. Change the code to execute the process() function directly without using Gradio.

input_image = cv2.imread("test_imgs/pose1.png") output = process(input_image, prompt, a_prompt, n_prompt, num_samples, image_resolution, detect_resolution, ddim_steps, guess_mode, strength, scale, seed, eta)

Refer to the default definitions for each parameter. Then, add the following at the end of the process() function.

x_samples = model.decode_first_stage(samples) x_samples = (einops.rearrange(x_samples, 'b c h w -> b h w c') * 127.5 + 127.5).cpu().numpy().clip(0, 255).astype(np.uint8) results = [x_samples[i] for i in range(num_samples)] for i, img in enumerate(results): cv2.imwrite(f'output_image_{i}.png', img)

안녕하세요! 나도 같은 문제가 있습니다. gradio로 인해 생기는 문제로 생각됩니다. run 버튼을 눌러도 process()가 실행하지 않아요. 다음과 같이 코드를 수정하여 gradio를 이용하지 않고 opencv를 이용하도록 했습니다. 각 매개변수는 기본으로 정의되어 있는 내용을 참고하세요 그 다음 process() 마지막에 다음을 추가합니다.