Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
ef5a863
1
Parent(s):
88eaf54
spacesgpu
Browse files
app.py
CHANGED
@@ -273,17 +273,17 @@ with gr.Blocks() as demo:
|
|
273 |
|
274 |
# Initialize both pipelines
|
275 |
if __name__ == "__main__":
|
276 |
-
from diffusers import FluxTransformer2DModel, FluxPipeline
|
277 |
# Initialize Flux pipeline
|
278 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
279 |
huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
|
280 |
|
281 |
-
quantization_config = BitsAndBytesConfig(load_in_4bit=True)
|
282 |
hf_token = ""
|
283 |
dtype = torch.bfloat16
|
284 |
file_url = "https://huggingface.co/gokaygokay/flux-game/blob/main/gokaygokay_00001_.safetensors"
|
285 |
single_file_base_model = "camenduru/FLUX.1-dev-diffusers"
|
286 |
-
transformer = FluxTransformer2DModel.from_single_file(file_url, subfolder="transformer", torch_dtype=dtype, config=single_file_base_model
|
287 |
flux_pipeline = FluxPipeline.from_pretrained(single_file_base_model, transformer=transformer, torch_dtype=dtype, token=huggingface_token, quantization_config=quantization_config)
|
288 |
|
289 |
# Initialize Trellis pipeline
|
|
|
273 |
|
274 |
# Initialize both pipelines
|
275 |
if __name__ == "__main__":
|
276 |
+
from diffusers import FluxTransformer2DModel, FluxPipeline
|
277 |
# Initialize Flux pipeline
|
278 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
279 |
huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
|
280 |
|
281 |
+
#quantization_config = BitsAndBytesConfig(load_in_4bit=True)
|
282 |
hf_token = ""
|
283 |
dtype = torch.bfloat16
|
284 |
file_url = "https://huggingface.co/gokaygokay/flux-game/blob/main/gokaygokay_00001_.safetensors"
|
285 |
single_file_base_model = "camenduru/FLUX.1-dev-diffusers"
|
286 |
+
transformer = FluxTransformer2DModel.from_single_file(file_url, subfolder="transformer", torch_dtype=dtype, config=single_file_base_model)
|
287 |
flux_pipeline = FluxPipeline.from_pretrained(single_file_base_model, transformer=transformer, torch_dtype=dtype, token=huggingface_token, quantization_config=quantization_config)
|
288 |
|
289 |
# Initialize Trellis pipeline
|