Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -39,6 +39,24 @@ import re, operator
|
|
39 |
|
40 |
chromadb.api.client.SharedSystemClient.clear_system_cache()
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
class MultiAgentState(BaseModel):
|
43 |
state: List[str] = []
|
44 |
messages: Annotated[list[AnyMessage], add_messages]
|
|
|
39 |
|
40 |
chromadb.api.client.SharedSystemClient.clear_system_cache()
|
41 |
|
42 |
+
|
43 |
+
import torch
|
44 |
+
from diffusers import DiffusionPipeline
|
45 |
+
import numpy as np
|
46 |
+
import random
|
47 |
+
|
48 |
+
# Load FLUX.1-schnell model
|
49 |
+
torch_dtype = torch.bfloat16 if torch.cuda.is_available() else torch.float32
|
50 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
51 |
+
|
52 |
+
pipe = DiffusionPipeline.from_pretrained(
|
53 |
+
"black-forest-labs/FLUX.1-schnell",
|
54 |
+
torch_dtype=torch_dtype
|
55 |
+
).to(device)
|
56 |
+
|
57 |
+
MAX_SEED = np.iinfo(np.int32).max
|
58 |
+
|
59 |
+
|
60 |
class MultiAgentState(BaseModel):
|
61 |
state: List[str] = []
|
62 |
messages: Annotated[list[AnyMessage], add_messages]
|