Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -9,17 +9,11 @@ from typing import Dict
|
|
9 |
from PIL import Image
|
10 |
from huggingface_hub import Repository
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
engine_repo = Repository(local_dir="engine", clone_from="felixrosberg/EngageDiffusion", use_auth_token=token)
|
15 |
|
16 |
from engine.ui_model import fetch_model, run_model
|
17 |
from engine.ui_gradio import fetch_ui
|
18 |
|
19 |
-
engage_logo = Image.open("engage_studios_logo.png").resize((700, 88), Image.Resampling.BICUBIC)
|
20 |
-
engage_logo_mask = np.clip(np.array(engage_logo.split()[-1])[..., None] / 255, 0, 1)
|
21 |
-
engage_logo_np = np.array(engage_logo.convert('RGB'))
|
22 |
-
|
23 |
pipe = fetch_model()
|
24 |
pipe.to('cuda')
|
25 |
|
@@ -95,11 +89,6 @@ def inference(user_state, condition_image, settings, prompt, neg_prompt, inferen
|
|
95 |
seed,
|
96 |
progress)
|
97 |
|
98 |
-
for idx, im in enumerate(images):
|
99 |
-
im = np.asarray(im).copy()
|
100 |
-
im[-88:, :700] = im[-88:, :700] * (1 - engage_logo_mask) + engage_logo_np
|
101 |
-
images[idx] = Image.fromarray(np.clip(im.astype('uint8'), 0, 255))
|
102 |
-
|
103 |
user_state["IMAGE_GALLERY"] += images
|
104 |
return user_state["IMAGE_GALLERY"], user_state
|
105 |
|
|
|
9 |
from PIL import Image
|
10 |
from huggingface_hub import Repository
|
11 |
|
12 |
+
engine_repo = Repository(local_dir="engine", clone_from="felixrosberg/EngageDiffusion", use_auth_token=os.environ['model_fetch'])
|
|
|
|
|
13 |
|
14 |
from engine.ui_model import fetch_model, run_model
|
15 |
from engine.ui_gradio import fetch_ui
|
16 |
|
|
|
|
|
|
|
|
|
17 |
pipe = fetch_model()
|
18 |
pipe.to('cuda')
|
19 |
|
|
|
89 |
seed,
|
90 |
progress)
|
91 |
|
|
|
|
|
|
|
|
|
|
|
92 |
user_state["IMAGE_GALLERY"] += images
|
93 |
return user_state["IMAGE_GALLERY"], user_state
|
94 |
|