|
|
|
|
|
by Der_Einzige
987 days ago
|
|
Custom loss functions absolutely work and work basically the way described above. https://colab.research.google.com/drive/1dlgggNa5Mz8sEAGU0wF... You can see them define a custom color loss and apply it simultaneously with the regular diffusion loss. I've actually expanded this notebook to allow regional specification of the custom loss. It's quite difficult to define a function that detects if an individual has 5 fingers or not. That's the real issue. |
|
My point was that it doesn't actually think like that. For example, prompting StableDiffusion for a picture of a doctor doesn't necessarily get it to draw a human at all, much less a doctor of a pre-determined sex; instead, StableDiffusion de-noises the image until the result emerges, where that result would (ideally) contain a doctor of whatever sex it happened to come up with.
That said, you're right that we can add more code to try to guide things.
We could even just brute-force it by just re-generating images over-and-over, or tweaking them after generation, until they match exactly what we wanted. (Realistically, something like branch-and-bound would probably be preferred to blindly guess-and-check-ing.)