further cleanup
This commit is contained in:
parent
ff1086c06f
commit
a04d139ff5
@ -6,7 +6,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
precision: mx.Dtype = mx.float16
|
precision: mx.Dtype = mx.bfloat16
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
from math import e
|
|
||||||
from cycler import V
|
|
||||||
import mlx.core as mx
|
import mlx.core as mx
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
|||||||
38
trial.py
38
trial.py
@ -1,38 +0,0 @@
|
|||||||
import os
|
|
||||||
import sys
|
|
||||||
from mflux.post_processing.image_util import ImageUtil
|
|
||||||
|
|
||||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
|
||||||
|
|
||||||
from mflux.config.model_config import ModelConfig
|
|
||||||
from mflux.config.config import ConfigControlnet
|
|
||||||
from mflux.controlnet.flux_controlnet import Flux1Controlnet
|
|
||||||
|
|
||||||
prompt = "Luxury picture of food"
|
|
||||||
|
|
||||||
|
|
||||||
# Load the model
|
|
||||||
flux = Flux1Controlnet(
|
|
||||||
model_config=ModelConfig.from_alias("dev"),
|
|
||||||
quantize=8,
|
|
||||||
lora_paths=["Flux_1_Dev_LoRA_Paper-Cutout-Style.safetensors"]
|
|
||||||
)
|
|
||||||
|
|
||||||
control_image = ImageUtil.load_image("image_1.png")
|
|
||||||
|
|
||||||
# Generate an image
|
|
||||||
image = flux.generate_image(
|
|
||||||
seed=2500,
|
|
||||||
prompt=prompt,
|
|
||||||
control_image=control_image,
|
|
||||||
config=ConfigControlnet(
|
|
||||||
num_inference_steps=10,
|
|
||||||
height=256,
|
|
||||||
width=512,
|
|
||||||
guidance=3.5,
|
|
||||||
controlnet_strength=0.7,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
# Save the image
|
|
||||||
image.save(path="image.png", export_json_metadata=False)
|
|
||||||
Loading…
Reference in New Issue
Block a user