import torch
from diffusers import DiffusionPipeline
model_id = 'black-forest-labs/FLUX.1-dev'
adapter_id = 'quzo/bart2a100'
pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
pipeline.load_lora_weights(adapter_id)
prompt = "photo of b1982 man"## Optional: quantise the model to save on vram.## Note: The model was not quantised during training, so it is not necessary to quantise it during inference time.#from optimum.quanto import quantize, freeze, qint8#quantize(pipeline.transformer, weights=qint8)#freeze(pipeline.transformer)
pipeline.to('cuda'if torch.cuda.is_available() else'mps'if torch.backends.mps.is_available() else'cpu') # the pipeline is already in its target precision level
model_output = pipeline(
prompt=prompt,
num_inference_steps=20,
generator=torch.Generator(device='cuda'if torch.cuda.is_available() else'mps'if torch.backends.mps.is_available() else'cpu').manual_seed(42),
width=1024,
height=1024,
guidance_scale=3.0,
).images[0]
model_output.save("output.png", format="PNG")
Runs of quzo bart2a100 on huggingface.co
2
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About bart2a100 huggingface.co Model
bart2a100 huggingface.co is an AI model on huggingface.co that provides bart2a100's model effect (), which can be used instantly with this quzo bart2a100 model. huggingface.co supports a free trial of the bart2a100 model, and also provides paid use of the bart2a100. Support call bart2a100 model through api, including Node.js, Python, http.
bart2a100 huggingface.co is an online trial and call api platform, which integrates bart2a100's modeling effects, including api services, and provides a free online trial of bart2a100, you can try bart2a100 online for free by clicking the link below.
bart2a100 is an open source model from GitHub that offers a free installation service, and any user can find bart2a100 on GitHub to install. At the same time, huggingface.co provides the effect of bart2a100 install, users can directly use bart2a100 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.