ControlNet icon indicating copy to clipboard operation
ControlNet copied to clipboard

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

Open huangkaipeng4399 opened this issue 2 years ago • 7 comments

图片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 avatar Jan 23 '24 07:01 huangkaipeng4399

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

huangkaipeng4399 avatar Jan 23 '24 07:01 huangkaipeng4399

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

S2Guidance avatar Feb 01 '24 05:02 S2Guidance

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

GauravGajbhiye avatar Feb 06 '24 11:02 GauravGajbhiye

@GauravGajbhiye @tobbler Not yet. How about you?

huangkaipeng4399 avatar Feb 23 '24 06:02 huangkaipeng4399

这个问题是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

crazy-zxx avatar Mar 06 '24 17:03 crazy-zxx

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

huangkaipeng4399 avatar Mar 25 '24 05:03 huangkaipeng4399

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() 마지막에 다음을 추가합니다.

cjsal95 avatar Jul 03 '24 16:07 cjsal95