It took a long time for the mainstream to come around to Louis C.K. Before his hit FX show, “Louie,” lies a trail of commercial (not to say artistic) failures. No one much watched his first TV show, the anti-sitcom “Lucky Louie,” and the 2001 meta satire “Pootie Tang” was long a punchline, loved only by a precious few who got on its strange wavelength. (It’s worth noting that the comic was very successful working with Chris Rock and Robert Smigel, as well as on the writing staff of “Saturday Night Live” among others.)

At 46, he can finally do whatever he wants. “Louie” is a full-on auteur project, which he writes, directs, edits and stars in, tackling whatever odd subjects he likes. He can even grant new life to works that once met with chilly indifference. Recently, he made “Tomorrow Night,” his feature directorial debut, available on his website. It premiered at Sundance in 1998, but was unable to secure a distributor. Now anyone can download it for $5, and many probably will — because it’s a film by Louis C.K, whose every vulgar utterance goes viral.

It’s here that one would normally give “Tomorrow Night” a condescending appraisal, noting that it’s a sign of greatness to come but, on its own, remains too unwieldy to appreciate as more than a completionist curio. And that’s not wrong. Designed to be off-putting, “Tomorrow Night” is a black-and-white 16mm character study of Charles (Chuck Sklar), a loner who owns a photo store. (The love for old school analogue technology must have seemed strange even in the late ‘90s.) He’s young but has the cantankerous attitude of a man thrice his age. By day he gives the cold shoulder to his scant clientele; by night he engages in a wacky sexual fetish involving ice cream.

That last bit is the most notable — and not only — example of the broad, even juvenile tendencies he got out of his system with “Tomorrow Night” (and surely with the many shows he worked on). It’s true he would eventually pare his work down to the precise, handmade quality that marks every episode of “Louie.” But his detached, bemused view of human misery was always there.

Charles is never likable, and only briefly suggests a melancholy undertone. C.K. orchestrates for him to fall for an older woman (Martha Greenhouse). That may make it sound quirky-indie, but this isn’t “Harold and Maude.” She's no free spirit, but a slightly batty whiner with an abusive grotesque of a husband. Their courtship isn’t terribly romantic or exciting. (“I find your tidiness to be appealing,” is Charles’ version of a come-on.) Moreover, it doesn’t go the way one would imagine, and one could even picture a less absurdist version of this tale of disappointment winding up in a future “Louie.”

Because C.K. was a staffer on late night comedy shows, many familiar faces pop up, notably Steve Carell and Robert Smigel, who play giggling Army mail room staffers who torture a dim private seemingly lifted out of a stiff 1950s education film. His former boss, Conan O’Brien, even crops up for a bitter parody of late night joke-flinging. This brief bit might be the most revealing part of “Tomorrow Night.” There’s a strong trace of suffocation in the film, made by a struggling comic confined to working on the margins of mainstream comedy. This film is his chance to break out, mostly by acting out.

Throughout the film runs a passion for the underground New York City cinema of the 1960s and its resurgence in the ‘70s and ‘80s, which is filtered through a late ‘90s smart-ass comic sensibility. The shots are grainy and immobile, held a few beats too long. It's part Jim Jarmusch's "Stranger Than Paradise," part "Eraserhead." (The opening shot is almost a David Lynch parody, with a dread frog floating in a puddle in the rain.) Like “Pootie Tang” and “Lucky Louie,” it’s the work of a smart and aware artist actively antagonizing the audience. That C.K. would one day no longer care who he was making his work for seems to have done the trick.