replicate-python icon indicating copy to clipboard operation
replicate-python copied to clipboard

Inconsistent output between different flux model

Open dulalbert opened this issue 1 year ago • 1 comments

Using flux schnell and flux dev output the image in base64 while black-forest-labs/flux-1.1-pro outputs directly the link to the image on replicate server. Is it normal ?

Here is the used call for schnell:

output = replicate.run( "black-forest-labs/flux-schnell", input={ "prompt": "A cake", "go_fast": True, "aspect_ratio": "1:1", "output_quality": 80, "num_inference_steps": 4, "output_format": "jpg", },

dulalbert avatar Oct 11 '24 03:10 dulalbert

Using flux schnell and flux dev output the image in base64 while black-forest-labs/flux-1.1-pro outputs directly the link to the image on replicate server. Is it normal ?

Here is the used call for schnell:

output = replicate.run( "black-forest-labs/flux-schnell", input={ "prompt": "A cake", "go_fast": True, "aspect_ratio": "1:1", "output_quality": 80, "num_inference_steps": 4, "output_format": "jpg", },

same with schnell, wasn't this working before though ? it started blowing up all of a sudden or i'm having some sort of false memory ?

damn, its not consistent even for base64 this is what i am doing rn:

def base64toimage(data):
    if isinstance(data, replicate.helpers.FileOutput):
        data = data.read()
    elif isinstance(data, bytes):
        pass  # bytes already
    else:
        if data.startswith('data:image') or data.startswith('data:application'):
            data = data.split('base64,')[1]
        data = base64.b64decode(data)
    
    return Image.open(io.BytesIO(data))

AusafG5 avatar Oct 14 '24 16:10 AusafG5