Skip to content

Commit

Permalink
fix decoder/refiner on incorrect device
Browse files Browse the repository at this point in the history
  • Loading branch information
Teriks committed Sep 12, 2024
1 parent 770ea00 commit cdc7806
Show file tree
Hide file tree
Showing 138 changed files with 201 additions and 199 deletions.
126 changes: 63 additions & 63 deletions README.rst

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dgenerate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

__version__ = '4.1.0'
__version__ = '4.1.1'

import os
import sys
Expand Down
2 changes: 1 addition & 1 deletion dgenerate/console/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

__version__ = '4.1.0'
__version__ = '4.1.1'

from dgenerate.console.console import main
2 changes: 2 additions & 0 deletions dgenerate/pipelinewrapper/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2242,6 +2242,7 @@ def _lazy_init_pipeline(self, pipeline_type):
safety_checker=self._safety_checker,
extra_modules=self._second_model_extra_modules,
auth_token=self._auth_token,
device=self._device,
local_files_only=self._local_files_only,
vae_tiling=self._vae_tiling,
vae_slicing=self._vae_slicing,
Expand Down Expand Up @@ -2324,6 +2325,7 @@ def _lazy_init_pipeline(self, pipeline_type):

safety_checker=self._safety_checker,
auth_token=self._auth_token,
device=self._device,
extra_modules=refiner_extra_modules,
local_files_only=self._local_files_only,
vae_tiling=self._vae_tiling,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# CivitAI has recently made a change to their website UI
# which prevents you from right clicking and copying
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# you need to have a civitai.com account and to set up an API token
# in your account settings in order to be able to download these models
Expand Down
2 changes: 1 addition & 1 deletion examples/config_directives/exec/exec-directive-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# run dgenerate as a subprocess, read a config
# and send stdout and stderr to a file
Expand Down
2 changes: 1 addition & 1 deletion examples/config_syntax/basic-syntax-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# If a hash-bang version is provided in the format above
# a warning will be produced if the version you are running
Expand Down
2 changes: 1 addition & 1 deletion examples/config_syntax/directives-templating-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# You can define your own template variables with the \set directive
# the \set directive does not do any shell args parsing on its value
Expand Down
2 changes: 1 addition & 1 deletion examples/config_syntax/env-directive-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

\env MY_ENV_VAR=1 MY_ENV_VAR2=2

Expand Down
2 changes: 1 addition & 1 deletion examples/config_syntax/globing-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# globbing can be preformed via shell expansion or using
# the glob module inside jinja templates
Expand Down
2 changes: 1 addition & 1 deletion examples/config_syntax/set-directive-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

\set my_variable "I am an incomplete string and this is completely fine because I am a raw value

Expand Down
2 changes: 1 addition & 1 deletion examples/config_syntax/sete-directive-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1


\sete my_variable --argument ./*
Expand Down
2 changes: 1 addition & 1 deletion examples/config_syntax/setp-directive-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

\setp my_variable 10*10

Expand Down
2 changes: 1 addition & 1 deletion examples/config_syntax/tail-comments-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# the ability to use tail comments requires a non trivial parse
# that creates some penalty over the usage of the # character
Expand Down
2 changes: 1 addition & 1 deletion examples/deepfloyd/animation/config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

\set image_to_vary ../../media/rickroll-roll.gif

Expand Down
2 changes: 1 addition & 1 deletion examples/deepfloyd/basic/config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

\set token %HF_TOKEN%

Expand Down
2 changes: 1 addition & 1 deletion examples/deepfloyd/img2img/config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

\set image_to_vary ../../media/dog-on-bench.png

Expand Down
2 changes: 1 addition & 1 deletion examples/deepfloyd/inpaint/config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

\set image_to_vary ../../media/dog-on-bench.png
\set mask_image ../../media/dog-on-bench-mask.png
Expand Down
2 changes: 1 addition & 1 deletion examples/flux/basic/flux-dev-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

\set token %HF_TOKEN%

Expand Down
2 changes: 1 addition & 1 deletion examples/flux/basic/flux-schnell-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

\set token %HF_TOKEN%

Expand Down
2 changes: 1 addition & 1 deletion examples/flux/lora/config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

\set token %HF_TOKEN%

Expand Down
2 changes: 1 addition & 1 deletion examples/flux/prompt_weighting/flux-sd-embed-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

\set token %HF_TOKEN%

Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/anyline-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# run the anyline processor

Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/canny-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# Get arguments help and continue, this does not cause dgenerate to exit

Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/hed-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# run the hed (edge) detector

Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/leres-depth-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# run the LeReS depth detector

Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/lineart-anime-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# run the lineart anime model

Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/lineart-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# run the lineart model

Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/lineart-standard-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# run the lineart-standard processor

Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/midas-depth-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# run the MiDaS depth detector

Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/midas-normals-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# run the MiDaS depth detector, but generate a normal map from the depth image.

Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/mlsd-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# run the mlsd processor (Machine Learning Model for Detecting Wireframes)

Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/normal-bae-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# generate a normal map

Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/openpose-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# Get arguments help and continue, this does not cause dgenerate to exit

Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/pidi-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# run the pid net edge detector

Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/resize-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

\set device_switch {{ '--device '+injected_device if injected_device else '' }}

Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/segment-anything-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

\set device_switch {{ '--device '+injected_device if injected_device else '' }}

Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/teed-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# run the teed processor (edge detector)

Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/upscaler-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1


\set device_switch {{ '--device '+injected_device if injected_device else '' }}
Expand Down
2 changes: 1 addition & 1 deletion examples/image_process/zoe-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# run the zoe depth detector

Expand Down
2 changes: 1 addition & 1 deletion examples/library_usage/run_config/example-input.dgen
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

\print Hello World!
2 changes: 1 addition & 1 deletion examples/library_usage/run_config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


config = r"""
#! dgenerate 4.1.0
#! dgenerate 4.1.1
stabilityai/stable-diffusion-2 --prompts "a man walking on the moon without a space suit"
Expand Down
2 changes: 1 addition & 1 deletion examples/stablecascade/basic/config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

stabilityai/stable-cascade-prior
--model-type torch-s-cascade
Expand Down
2 changes: 1 addition & 1 deletion examples/stablecascade/batchsize/config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

stabilityai/stable-cascade-prior
--model-type torch-s-cascade
Expand Down
2 changes: 1 addition & 1 deletion examples/stablecascade/img2img/basic-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

stabilityai/stable-cascade-prior
--model-type torch-s-cascade
Expand Down
2 changes: 1 addition & 1 deletion examples/stablecascade/img2img/multiple-inputs-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# Stable Cascade can accept multiple input images and derive a style from it

Expand Down
2 changes: 1 addition & 1 deletion examples/stablecascade/unet_lite/config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

stabilityai/stable-cascade-prior
--model-type torch-s-cascade
Expand Down
2 changes: 1 addition & 1 deletion examples/stablediffusion/animations/astley-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1


# Complete transformation with canny edge detection
Expand Down
2 changes: 1 addition & 1 deletion examples/stablediffusion/animations/kitten-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1


# Strange but interesting upscaling effect on a gif
Expand Down
2 changes: 1 addition & 1 deletion examples/stablediffusion/basic/config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

stabilityai/stable-diffusion-2
--inference-steps 40
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# Generate 4 images simultaneously on the GPU and create a 2x2 grid for each frame of the animation
# The kitten gif is 498x286, meaning the resized images will not be square
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# Generate 4 images simultaneously on the GPU, write to 4 different animations

Expand Down
2 changes: 1 addition & 1 deletion examples/stablediffusion/batchsize/static-grid-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# Place the variations side by side on an image grid
# That is 2 wide and 1 high
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# Write the variations as separate files to the output directory with the suffix _image_N

Expand Down
2 changes: 1 addition & 1 deletion examples/stablediffusion/controlnet/boxer-config.dgen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env dgenerate --file
#! dgenerate 4.1.0
#! dgenerate 4.1.1

# Utilize the OpenPose ControlNet with an OpenPose rigging image
# that is generated by the built in OpenPose image processor action
Expand Down
Loading

0 comments on commit cdc7806

Please sign in to comment.