Skip to content

Commit

Permalink
#16 create stablediffusion-lowram.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
ddPn08 committed Jan 5, 2023
1 parent 9a8d6a5 commit 2748452
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions patches/stablediffusion-lowram.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/ldm/util.py b/ldm/util.py
index 8c09ca1..5c2fd6d 100644
--- a/ldm/util.py
+++ b/ldm/util.py
@@ -76,7 +76,9 @@ def instantiate_from_config(config):
elif config == "__is_unconditional__":
return None
raise KeyError("Expected key `target` to instantiate.")
- return get_obj_from_str(config["target"])(**config.get("params", dict()))
+ model = get_obj_from_str(config["target"])(**config.get("params", dict()))
+ model.cuda()
+ return model


def get_obj_from_str(string, reload=False):

0 comments on commit 2748452

Please sign in to comment.