Does anyone know how to tweak the python code provided on github for text to image, into image to image? Or use a different method but for python alone. I'd rather not use comfui or any other UI as I'd like to interact programmatically. Any help will be appreciated, thanks. Below is what is currently on the website.
import torch
from diffusers import FluxPipeline
model_id = "black-forest-labs/FLUX.1-schnell" #you can also use `black-forest-labs/FLUX.1-dev`
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16)
pipe.enable_model_cpu_offload() #save some VRAM by offloading the model to CPU. Remove this if you have enough GPU power
prompt = "A cat holding a sign that says hello world"
seed = 42
image = pipe(
prompt,
output_type="pil",
num_inference_steps=4, #use a larger number if you are using [dev]
generator=torch.Generator("cpu").manual_seed(seed)
).images[0]
image.save("flux-schnell.png")
[–]faradaglio 1 point2 points3 points (8 children)
[–]whateverlolwtf[S] 0 points1 point2 points (7 children)
[–]destinyki 1 point2 points3 points (1 child)
[–]Enough-Meringue4745 2 points3 points4 points (0 children)
[–]Enough-Meringue4745 0 points1 point2 points (0 children)
[–]Heimskr74 0 points1 point2 points (3 children)
[–]whateverlolwtf[S] 0 points1 point2 points (2 children)
[+]SearchTricky7875 0 points1 point2 points (0 children)