Spaces:
Runtime error
Runtime error
lemonaddie
commited on
Update models/depth_normal_pipeline_clip_cfg.py
Browse files
models/depth_normal_pipeline_clip_cfg.py
CHANGED
@@ -75,6 +75,7 @@ class DepthNormalEstimationPipeline(DiffusionPipeline):
|
|
75 |
input_image:Image,
|
76 |
denosing_steps: int = 10,
|
77 |
ensemble_size: int = 10,
|
|
|
78 |
processing_res: int = 768,
|
79 |
match_input_res:bool =True,
|
80 |
batch_size:int = 0,
|
@@ -286,7 +287,8 @@ class DepthNormalEstimationPipeline(DiffusionPipeline):
|
|
286 |
# predict the noise residual
|
287 |
noise_pred = self.unet(unet_input, t.repeat(4), encoder_hidden_states=batch_img_embed, class_labels=class_embedding.repeat(2,1)).sample
|
288 |
noise_pred_uncond, noise_pred_cond = noise_pred.chunk(2)
|
289 |
-
guidance_scale = 3.
|
|
|
290 |
noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_cond - noise_pred_uncond)
|
291 |
|
292 |
# compute the previous noisy sample x_t -> x_t-1
|
|
|
75 |
input_image:Image,
|
76 |
denosing_steps: int = 10,
|
77 |
ensemble_size: int = 10,
|
78 |
+
guidance_scale: int = 1,
|
79 |
processing_res: int = 768,
|
80 |
match_input_res:bool =True,
|
81 |
batch_size:int = 0,
|
|
|
287 |
# predict the noise residual
|
288 |
noise_pred = self.unet(unet_input, t.repeat(4), encoder_hidden_states=batch_img_embed, class_labels=class_embedding.repeat(2,1)).sample
|
289 |
noise_pred_uncond, noise_pred_cond = noise_pred.chunk(2)
|
290 |
+
#guidance_scale = 3.
|
291 |
+
guidance_scale = guidance_scale
|
292 |
noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_cond - noise_pred_uncond)
|
293 |
|
294 |
# compute the previous noisy sample x_t -> x_t-1
|