Yuanshi9815 / OminiControl

A minimal and universal controller for FLUX.1.
586 stars 23 forks source link

inpainting.ipynb #19

Open lior007 opened 2 days ago

lior007 commented 2 days ago

if you use inpainting.ipynb with jupyter notebook 1.) i did upgrade to the file. and now you have grid with numcer of the coordinates 2.) add save output picture to folder

Screenshot 2024-11-25 201711 output1 Screenshot 2024-11-26 201929 output

instructions

after this cell:

pipe.load_lora_weights( "Yuanshi/OminiControl", weight_name=f"experimental/fill.safetensors", adapter_name="fill", )

make new cell and put:

image = Image.open(r"H:\GITHUB\OMINI CONTROL\assets\monalisa.jpg").convert("RGB").resize((512, 512)) from matplotlib import pyplot as plt plt.imshow(image) plt.xticks(range(0, 512, 32)) # חלוקה כל 32 פיקסלים plt.yticks(range(0, 512, 32)) plt.grid(True) plt.show()

and after that make a new cell and put:

masked_image = image.copy() masked_image.paste((0, 0, 0), (96, 32, 288, 192))

condition = Condition("fill", masked_image)

seed_everything() result_img = generate( pipe, prompt="The mona lisa is wearing a A red hat on the head.", conditions=[condition], ).images[0]

concat_image = Image.new("RGB", (1536, 512)) concat_image.paste(image, (0, 0)) concat_image.paste(condition.condition, (512, 0)) concat_image.paste(result_img, (1024, 0)) concat_image

after that cell make anew cell and put:

result_img.save(r"H:\GITHUB\OMINI CONTROL\output\output1.jpg")

thats all

Yuanshi9815 commented 20 hours ago

Thank you so much for sharing these detailed instructions and improvements! 🙏

The grid coordinates feature is a clever addition that can help users with precise masking. We've pinned your usage guide so other community members can easily find and reference these helpful enhancements when working with the inpainting notebook.

We appreciate community members like you who take the time to share their experiences with the project! 💫