lllyasviel / ControlNet

Let us control diffusion models!
Apache License 2.0
28.97k stars 2.62k forks source link

How to remove prompt in promptless CN #613

Open KhawlahB opened 6 months ago

KhawlahB commented 6 months ago

I am trying to do promptless training for ControlNet.

I am wondering what is the correct way to remove the prompt during model training on my dataset.

I need to train it for image2image task with conditional image

Should I pass empty string here?

Screenshot 2023-12-15 041043

or should i remove it completely from RETURN statement?

Screenshot 2023-12-15 041341

@williamyang1991 @lllyasviel @eltociear @camenduru

geroldmeisinger commented 6 months ago

Original ControlNet paper: "In the training process, we randomly replace 50% text prompts ct with empty strings. This approach increases ControlNet’s ability to directly recognize semantics in the input conditioning images (e.g., edges, poses, depth, etc.) as a replacement for the prompt."

KhawlahB commented 6 months ago

I have read this, but how to do it? should i provide a json file with 50% empty string?

Also, i want to experiment when all prompts are empty, do not know if that possible using the way that i have sent? @geroldmeisinger

geroldmeisinger commented 6 months ago

line 23: prompt = item['prompt'] if random() >= 0.5 else "" (updated: correct python)

KhawlahB commented 6 months ago

this line of code gonna replace 50% by random string? what is the purpose of using (random) number here? Can you pleas explain it in words, what the code you have written trying to do?

Also, if i am trying to remove the prompt completely-> replace 100% of prompts by empty string! can i do the same by changing the number from 0.5 to 1.0? i want to see the results if i remove the prompt...

@geroldmeisinger @williamyang1991 @scarbain @lllyasviel

geroldmeisinger commented 6 months ago

50:50 chance to use empty string

how long does it take for you to train a controlnet? couldn't you just try? did you already successfully train a controlnet without "extras"?

KhawlahB commented 6 months ago

@geroldmeisinger