shellypeng commited on
Commit
6281c75
·
verified ·
1 Parent(s): ffbe7e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -9
app.py CHANGED
@@ -58,6 +58,17 @@ hidden_negative = "bad anatomy, disfigured, poorly drawn,deformed, mutation, mal
58
  hidden_cn_booster_text = ",漂亮的脸"
59
  hidden_cn_negative = ""
60
 
 
 
 
 
 
 
 
 
 
 
 
61
  def translate(prompt):
62
  trans_text = prompt
63
  translated = model.generate(**tokenizer(trans_text, return_tensors="pt", padding=True))
@@ -70,10 +81,6 @@ def translate(prompt):
70
  def load_pipe_scribble():
71
  global pipe_scribble
72
  if pipe_scribble is None:
73
- hed = HEDdetector.from_pretrained('lllyasviel/ControlNet')
74
-
75
- controlnet_scribble = ControlNetModel.from_pretrained(
76
- "lllyasviel/sd-controlnet-scribble", torch_dtype=torch.float16, safety_checker=None, requires_safety_checker=False, )
77
 
78
  pipe_scribble = StableDiffusionControlNetPipeline.from_single_file(
79
  "https://huggingface.co/shellypeng/anime-god/blob/main/animeGod_v10.safetensors", controlnet=controlnet_scribble, safety_checker=None, requires_safety_checker=False,
@@ -97,11 +104,6 @@ def load_pipe_scribble():
97
  def load_pipe_depth():
98
  global pipe_depth
99
  if pipe_depth is None:
100
- depth_estimator = pipeline('depth-estimation')
101
-
102
- controlnet_depth = ControlNetModel.from_pretrained(
103
- "lllyasviel/sd-controlnet-depth", torch_dtype=torch.float16
104
- )
105
 
106
 
107
  pipe_depth = StableDiffusionControlNetPipeline.from_single_file(
 
58
  hidden_cn_booster_text = ",漂亮的脸"
59
  hidden_cn_negative = ""
60
 
61
+ hed = HEDdetector.from_pretrained('lllyasviel/ControlNet')
62
+
63
+ controlnet_scribble = ControlNetModel.from_pretrained(
64
+ "lllyasviel/sd-controlnet-scribble", torch_dtype=torch.float16, safety_checker=None, requires_safety_checker=False, )
65
+ depth_estimator = pipeline('depth-estimation')
66
+
67
+ controlnet_depth = ControlNetModel.from_pretrained(
68
+ "lllyasviel/sd-controlnet-depth", torch_dtype=torch.float16
69
+ )
70
+
71
+
72
  def translate(prompt):
73
  trans_text = prompt
74
  translated = model.generate(**tokenizer(trans_text, return_tensors="pt", padding=True))
 
81
  def load_pipe_scribble():
82
  global pipe_scribble
83
  if pipe_scribble is None:
 
 
 
 
84
 
85
  pipe_scribble = StableDiffusionControlNetPipeline.from_single_file(
86
  "https://huggingface.co/shellypeng/anime-god/blob/main/animeGod_v10.safetensors", controlnet=controlnet_scribble, safety_checker=None, requires_safety_checker=False,
 
104
  def load_pipe_depth():
105
  global pipe_depth
106
  if pipe_depth is None:
 
 
 
 
 
107
 
108
 
109
  pipe_depth = StableDiffusionControlNetPipeline.from_single_file(