Skip to content

img2img not working #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
InformEthics opened this issue Oct 25, 2024 · 1 comment
Open

img2img not working #42

InformEthics opened this issue Oct 25, 2024 · 1 comment

Comments

@InformEthics
Copy link

Thank you for doing this great project!
using mlx-FLUX.1-schnell-4bit-quantized model and providing a --image-path argument the img2img function does not work. Output image is the same as input image:

diffusionkit-cli --prompt "Hand drawn illustration of a boy reading for his teddy bear sitting on a treehouse, the boy is wearing a hat with bear ears, a scarf, and rainboots, next to him is a bookshelf with books on it, in the background it is raining, autumn colours." --image-path ~/Desktop/sketch.png --model-version argmaxinc/mlx-FLUX.1-schnell-4bit-quantized --denoise 0.5 --height 1360 --width 768 --step 4 --output ~/Desktop/test2.png

sketch

test2

@mplawner
Copy link

Hi @InformEthics

I’ve noticed something similar while experimenting and thought it might help shed some light on what’s going on. It seems like the --denoise and --steps settings interact in a way that affects the actual number of steps performed during processing.

For instance, when I used --denoise 0.5 with --steps 4, the system only ran 2 actual steps instead of 4. From what I can tell, it looks like the code might be multiplying the --denoise value by --steps to determine the effective number of steps. So, 0.5 × 4 = 2 steps in that case.

When I bumped up the --denoise to 0.775 while keeping --steps at 4, the output actually went through all 4 steps. My guess is that the calculation (0.775 × 4 = 3.1) gets rounded up to 4 steps, which seems to give more refined and expected results.

If you’re seeing similar behavior, try adjusting the --denoise value—something in the range of 0.7–0.8 worked well for me. It allowed the system to process the full number of steps and produce more detailed outputs.

I modified the prompt a bit, and got the attached result.

diffusionkit-cli --prompt "Hand drawn illustration of a boy reading for his teddy bear sitting on a treehouse, the boy is wearing a hat with bear ears, a scarf, and rainboots. His teddy bear is cuddling up to him. A lantern with butterflys hangs from the awning. Next to him is a bookshelf with books on it, in the background it is raining, autumn colours." --image-path sketch.png --model-version argmaxinc/mlx-FLUX.1-schnell-4bit-quantized --height 1360 --width 768 --step 4 --output test2.png --verbose --denoise 0.775
(Seed was 1736614223)
test2

Hopefully, this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants