Update src/pipeline.py
Browse files16 unmodified lines17181920212223242526272829303132336 unmodified lines4041424344454616 unmodified linestorch._dynamo.config.suppress_errors = TruePipeline = Noneids = "black-forest-labs/FLUX.1-schnell"Revision = "741f7c3ce8b383c54771c7003378a50191e9efe9"def load_pipeline() -> Pipeline:vae = AutoencoderTiny.from_pretrained("slobers/tt1",revision="ec746bf42d91e3335760895281f070df54f2196a", torch_dtype=torch.bfloat16,)text_encoder_2 = T5EncoderModel.from_pretrained("city96/t5-v1_1-xxl-encoder-bf16", revision = "1b9c856aadb864af93c1dcdc226c2774fa67bc86", torch_dtype=torch.bfloat16).to(memory_format=torch.channels_last)path = os.path.join(HF_HUB_CACHE, "models--RobertML--FLUX.1-schnell-int8wo/snapshots/307e0777d92df966a3c0f99f31a6ee8957a9857a")transformer = FluxTransformer2DModel.from_pretrained(path, torch_dtype=torch.bfloat16, use_safetensors=False).to(memory_format=torch.channels_last)pipeline = DiffusionPipeline.from_pretrained(ids, revision=Revision, vae=vae, transformer=transformer, text_encoder_2=text_encoder_2, torch_dtype=torch.bfloat16,)pipeline.to("cuda")for _ in range(3):pipeline(prompt="insensible, timbale, pothery, electrovital, actinogram, taxis, intracerebellar, centrodesmus", width=1024, height=1024, guidance_scale=0.0, num_inference_steps=4, max_sequence_length=256)return pipeline6 unmodified linesrequest.prompt,generator=generator,guidance_scale=0.0,num_inference_steps=4,max_sequence_length=256,height=request.height,width=request.width,16 unmodified lines171819202122232425262728293031326 unmodified lines3940414243444516 unmodified linestorch._dynamo.config.suppress_errors = TruePipeline = Noneids = "slobers/Flux.1.Schnella"Revision = "e34d670e44cecbbc90e4962e7aada2ac5ce8b55b"def load_pipeline() -> Pipeline:path = os.path.join(HF_HUB_CACHE, "models--slobers--Flux.1.Schnella/snapshots/e34d670e44cecbbc90e4962e7aada2ac5ce8b55b/transformer")transformer = FluxTransformer2DModel.from_pretrained(path, torch_dtype=torch.bfloat16, use_safetensors=False)pipeline = FluxPipeline.from_pretrained(ids, revision=Revision, transformer=transformer, local_files_only=True, torch_dtype=torch.bfloat16,)pipeline.to("cuda")quantize_(pipeline.vae, int8_weight_only())pipeline.transformer = torch.compile(pipeline.transformer, mode="max-autotune", fullgraph=True)for _ in range(3):pipeline(prompt="insensible, timbale, pothery, electrovital, actinogram, taxis, intracerebellar, centrodesmus", width=1024, height=1024, guidance_scale=0.0, num_inference_steps=4, max_sequence_length=256)return pipeline6 unmodified linesrequest.prompt,generator=generator,guidance_scale=0.0,num_inference_steps=1,max_sequence_length=256,height=request.height,width=request.width,
src/pipeline.py+8-9