What is the way to tell stable diffusion to output deterministic results? #1715
Replies: 8 comments 10 replies
-
Beta Was this translation helpful? Give feedback.
-
|
First thank for taking the time to answer me. It is highly appreciated! |
Beta Was this translation helpful? Give feedback.
-
|
I am building a rendering software for architects. i cannot ask them to renderer several view before rendering a final image. |
Beta Was this translation helpful? Give feedback.
-
|
To get consistent results, you should try adding the previews angle also as a reference and engineer the prompt around that. Related but for video that popped up a few days ago: https://huggingface.co/fal/LTX-2.3-3DREAL-LoRA |
Beta Was this translation helpful? Give feedback.
-
|
Following the discussion from #1730, since it is not really about any issues with the sd.cpp engine itself. To avoid having the model just copying the style reference image, I've made an attempt by repeating the 3d scene (passing the same image as 3 references), and flipping the style render, instructing the model to only get colors and textures from it. The best result so far was this mess:
But this may give us clues about why is it failing. To me, this looks like the model is identifying the elements, but not their identity: the objects on the second scene may have the same "style", but they are not the same objects. The model may simply be too dumb to understand this change. Image-wise, there are also other factors that make its job harder: the table color, for instance, is completely different. To make this work, it would need to understand the green crude render and the light wood texture are meant for the same object - again, having a strong notion of object identity. Unfortunately, I do not have ready answers for this. But if I was writing this software, I would try to lower the demand from the model, breaking the problem into smaller, simpler parts, and/or giving it additional clues. For instance:
|
Beta Was this translation helpful? Give feedback.
-
|
Made another test with the Sponza atrium Doesnt work :/ Reference is returned instead of the primary view ouput |
Beta Was this translation helpful? Give feedback.
-
|
And something strange. If i feed stable diffusion 2 raw renders. The second enhanced view is unfortunately returned. |
Beta Was this translation helpful? Give feedback.
-
|
@wbruna So i am stuck there :( :( :(. I will try your suggestion:
|
Beta Was this translation helpful? Give feedback.













Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using build 5a34bc7. Here the command that i use:
sd-cli.exe --backend vulkan0 --diffusion-model flux-2-klein-4b-Q8_0.gguf --llm Qwen3-4B-UD-Q4_K_XL.gguf --vae flux2.full_encoder_small_decoder.safetensors -p "turn the image into a high quality photograph" -r input_image.png -o output_photo.png --cfg-scale 2 --steps 4 --offload-to-cpu --fa --seed 42Let's take this example

I get this result:

With a change of the camera position/orientation:

I get this:

As you can see the scene changed. For instance the color of the entities circled in green changed! And objects in red in first render simply vanished.

I MADE another test. This time telling stable diffusion what to do.

Here the test scene:
The prompt:
Turn the image into a high quality photograph. Apply a white porcelain material on the teapot! Use white material for the water pitcher. Use light wood texture for the table. Use dark wood texture for the floor. Use a red metallic material for the light shades. Use a white porcelain material on the cups. Use a beach painting for the wall canvas. Use white material on the seats. Use light wood texture on the seat supports. Do not turn on the lights.
The negative prompt:
Lamp lights.
First camera output:

Everything looks as expected!
Second camera output:

I get almost the same scene. But the color of the areas circled in green changed :(
Third camera output:

Everything looks fine expect that the right shade color specified in the prompt is not respected.
My guess is that to get deterministic results i need to tell stable diffusion what it needs to do for the part of the scenes!
Tell me if i am wrong :)
For instance by adding " The light shade interiors must remain red" to the prompt the third test passes:

Here the second test input images:|
Beta Was this translation helpful? Give feedback.
All reactions