HelixNGC7293 / DeforumStableDiffusionLocal

Local version of Deforum Stable Diffusion, supports txt settings file input and animation features!
MIT License
713 stars 115 forks source link

match_histograms() got an unexpected keyword argument ' #54

Closed willjcim closed 1 year ago

willjcim commented 1 year ago

Rendering animation frame 16 of 240
  creating in between frame 8 tween:0.12
  creating in between frame 9 tween:0.25
  creating in between frame 10 tween:0.38
  creating in between frame 11 tween:0.50
  creating in between frame 12 tween:0.62
  creating in between frame 13 tween:0.75
  creating in between frame 14 tween:0.88
  creating in between frame 15 tween:1.00
Traceback (most recent call last):
  File "/home/apt/DeforumStableDiffusionLocal/run.py", line 488, in <module>
    main()
  File "/home/apt/DeforumStableDiffusionLocal/run.py", line 404, in main
    render_animation(args, anim_args, animation_prompts, root)
  File "/home/apt/DeforumStableDiffusionLocal/deforum-stable-diffusion/helpers/render.py", line 396, in render_animation
    prev_img = maintain_colors(prev_img, color_match_sample, anim_args.color_coherence)
  File "/home/apt/DeforumStableDiffusionLocal/deforum-stable-diffusion/helpers/colors.py", line 15, in maintain_colors
    matched_lab = match_histograms(prev_img_lab, color_match_lab, multichannel=True)
  File "/home/apt/miniconda3/envs/deforum/lib/python3.10/site-packages/skimage/_shared/utils.py", line 326, in fixed_func
    return func(*args, **kwargs)
TypeError: match_histograms() got an unexpected keyword argument 'multichannel'
willjcim commented 1 year ago

scikit-image 0.20.0 scikit-learn 1.2.1

willjcim commented 1 year ago

Solved: In deforum-stable-diffusion/helpers/colors.py

Change the following: return match_histograms(prev_img, color_match_sample, multichannel=True) -> return match_histograms(prev_img, color_match_sample, channel_axis=-1)

matched_hsv = match_histograms(prev_img_hsv, color_match_hsv, multichannel=True) -> matched_hsv = match_histograms(prev_img_hsv, color_match_hsv, channel_axis=-1)

matched_lab = match_histograms(prev_img_lab, color_match_lab, multichannel=True) -> matched_lab = match_histograms(prev_img_lab, color_match_lab, channel_axis=-1)

Will add a pull request shortly

willjcim commented 1 year ago

55

Limbicnation commented 1 year ago

matched_lab = match_histograms(prev_img_lab, color_match_lab, channel_axis=-1)

Thank you!