Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gpetters94 committed Feb 9, 2024
1 parent 37feded commit 99de56a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions apps/shark_studio/api/sd.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ def produce_img_latents(
text_embeddings_numpy = text_embeddings.detach().numpy()
guidance_scale = torch.Tensor([guidance_scale]).to(self.dtype)
self.load_submodels(["unet"])
control_scale = torch.tensor(1.0, dtype=self.dtype)
for i, t in tqdm(enumerate(total_timesteps)):
step_start_time = time.time()
timestep = torch.tensor([t]).to(self.dtype).detach().numpy()
Expand Down Expand Up @@ -337,6 +338,32 @@ def produce_img_latents(
timestep,
text_embeddings_numpy,
guidance_scale,
controlnet_latents[0],
controlnet_latents[1],
controlnet_latents[2],
controlnet_latents[3],
controlnet_latents[4],
controlnet_latents[5],
controlnet_latents[6],
controlnet_latents[7],
controlnet_latents[8],
controlnet_latents[9],
controlnet_latents[10],
controlnet_latents[11],
controlnet_latents[12],
control_scale,
control_scale,
control_scale,
control_scale,
control_scale,
control_scale,
control_scale,
control_scale,
control_scale,
control_scale,
control_scale,
control_scale,
control_scale,
],
)
# end_profiling(profile_device)
Expand Down
2 changes: 1 addition & 1 deletion apps/shark_studio/web/ui/sd.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ def base_model_changed(base_model_id):
)
with gr.Accordion(
label="Controlnet Options",
open=False,
open=True,
visible=True,
):
preprocessed_hints = gr.State([])
Expand Down

0 comments on commit 99de56a

Please sign in to comment.